Skip to content

Commit

Permalink
setup: migrate to afmformats 0.14.1
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Jun 29, 2021
1 parent 54335ce commit c9a4bf7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1.7.5
- ref: migrate `QMap` and `Group` code to afmformats 0.14.0
- ref: migrate `QMap` and `Group` code to afmformats 0.14.1
- ref: `Indentation` is now a subclass for `afmformats.AFMForceDistance`
- ref: `QMap` is now a subclass for `afmformats.AFMQMap`
- ref: `Group` is now a subclass for `afmformats.AFMGroup`
Expand Down
24 changes: 17 additions & 7 deletions nanite/qmap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import warnings

import afmformats
from afmformats.afm_qmap import qmap_feature
import numpy as np

from .indent import Indentation
Expand Down Expand Up @@ -33,10 +34,13 @@ def __init__(self, path_or_group, meta_override=None, callback=None):
)

@staticmethod
@qmap_feature(name="fit: contact point",
unit="nm",
cache=False)
def feat_fit_contact_point(idnt):
"""fit: contact point [nm]"""
if idnt.fit_properties and idnt.fit_properties["success"]:
# use cached rating
"""Contact point of the fit"""
if idnt.fit_properties.get("success", False):
# use cached contact point
params = idnt.fit_properties["params_fitted"]
value = params["contact_point"].value * 1e9
else:
Expand All @@ -48,10 +52,13 @@ def feat_fit_contact_point(idnt):
return value

@staticmethod
@qmap_feature(name="fit: Young's modulus",
unit="Pa",
cache=False)
def feat_fit_youngs_modulus(idnt):
"""fit: Young's modulus [Pa]"""
if idnt.fit_properties and idnt.fit_properties["success"]:
# use cached rating
"""Young's modulus"""
if idnt.fit_properties.get("success", False):
# use cached young's modulus
value = idnt.fit_properties["params_fitted"]["E"].value
else:
msg = "The experimental data has not been fitted. Please call " \
Expand All @@ -62,8 +69,11 @@ def feat_fit_youngs_modulus(idnt):
return value

@staticmethod
@qmap_feature(name="fit: rating",
unit="",
cache=False)
def feat_meta_rating(idnt):
"""fit: rating []"""
"""Rating"""
if idnt._rating is None:
msg = "The experimental data has not been rated. Please call " \
+ "`idnt.rate_quality` manually for {}!".format(idnt)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
license="GPL v3",
description=description,
long_description=open('README.rst').read() if exists('README.rst') else '',
install_requires=["afmformats>=0.14.0",
install_requires=["afmformats>=0.14.1",
"h5py>=2.8.0",
"lmfit>=1",
"numpy>=1.16.0", # cython build
Expand Down

0 comments on commit c9a4bf7

Please sign in to comment.