Skip to content

Commit

Permalink
- ref: bump nanite to 1.2.0
Browse files Browse the repository at this point in the history
 - ref: migrate to afmformats (0.3.0)
  • Loading branch information
paulmueller committed Sep 30, 2019
1 parent bfa8e20 commit 2c9e2f5
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 20 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
0.5.2
- ref: bump nanite to 1.2.0 (afmformats)
- ref: bump nanite to 1.2.0
- ref: migrate to afmformats (0.3.0)
0.5.1
- fix: missing title in FD window and missing FD number in export menu
- enh: add help menu with link to docs, about, and software used (#1)
Expand Down
2 changes: 1 addition & 1 deletion pyjibe/fd/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


def save_tsv_approach_retract(filename, fdist_list, ratings=[]):
"""Export a list of afmlib.ApproachRetract instances"""
"""Export fitting results for a list of nanite.Indentation"""

columns = []

Expand Down
8 changes: 4 additions & 4 deletions pyjibe/fd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import pkg_resources
import time

import afmformats
import nanite
import nanite.fit as nfit
import nanite.read as nread
import numpy as np
from PyQt5 import uic, QtCore, QtGui, QtWidgets

Expand Down Expand Up @@ -144,8 +144,8 @@ def callback(partial):
try:
grp = nanite.IndentationGroup(f, callback=callback)
callback(1)
except nread.read_jpk_meta.ReadJPKMetaKeyError:
# ignore callibration curves
except afmformats.errors.FileFormatMetaDataError:
# ignore e.g. JPK callibration curves
callback(1)
continue
except AbortProgress:
Expand Down Expand Up @@ -473,7 +473,7 @@ def on_rating_threshold(self):
else:
it.setCheckState(3, 0)
# TODO:
# -make this more efficient. There is a lot written to disk here.
# - make this more efficient. There is a lot written to disk here.
for fdist in self.data_set:
self.autosave(fdist)

Expand Down
8 changes: 4 additions & 4 deletions pyjibe/head/custom_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ def _icon(self, name):

def save_data(self, *args):
fname, _e = QtWidgets.QFileDialog.getSaveFileName(
self, "Save raw data", "", "Tab Separated Values (*.tsv)")
self, "Save raw data", "", "Tab Separated Values (*.tab)")
if fname:
if not fname.endswith(".tsv"):
fname += ".tsv"
if not fname.endswith(".tab"):
fname += ".tab"
self.save_data_callback(fname)

def save_data_callback(self, filename):
"""Save the plot data to a tsv file
"""Save the plot data to a tab file
"""
raise ValueError("This Method must be overridden!")

Expand Down
8 changes: 5 additions & 3 deletions pyjibe/head/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from PyQt5 import uic, QtCore, QtWidgets

import afmformats
import appdirs
import h5py
import lmfit
Expand Down Expand Up @@ -127,7 +128,7 @@ def on_open_multiple(self, evt=None):
self.settings.set_path(dlg.getDirectory(), name="load data")

def on_open_single(self, evt=None):
exts = ["*"+e for e in registry.file_extensions]
exts = ["*"+e for e in registry.known_suffixes]
exts_str = "Supported file types ({})".format(" ".join(exts))
search_dir = self.settings.get_path("load data")

Expand All @@ -139,7 +140,8 @@ def on_open_single(self, evt=None):
self.settings.set_path(pathlib.Path(n).parent, name="load data")

def on_software(self):
libs = [appdirs,
libs = [afmformats,
appdirs,
h5py,
lmfit,
matplotlib,
Expand All @@ -165,7 +167,7 @@ def load_data(self, files, retry_open=None, separate_analysis=False):
supfiles = []
for ff in files:
path = pathlib.Path(ff)
if path.suffix in registry.file_extensions:
if path.suffix in registry.known_suffixes:
supfiles.append(ff)

# check if AFM files were found
Expand Down
16 changes: 10 additions & 6 deletions pyjibe/registry.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
from afmformats.formats import formats_by_mode

from . import fd


analysis_types = {"fd":
{"file extensions": [".jpk", ".jpk-force", ".jpk-force-map"],
"gui": fd.UiForceDistance,
}}
analysis_types = {
"fd": {
"suffixes": [f["suffix"] for f in formats_by_mode["force-distance"]],
"gui": fd.UiForceDistance,
}
}

file_extensions = []
known_suffixes = []
for _item in analysis_types.values():
file_extensions += _item["file extensions"]
known_suffixes += _item["suffixes"]
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
license="GPL v3",
description=description,
long_description=open('README.rst').read() if exists('README.rst') else '',
install_requires=["appdirs",
install_requires=["afmformats>=0.3.0",
"appdirs",
"nanite>=1.2.0",
"matplotlib",
"pyqt5"],
Expand Down

0 comments on commit 2c9e2f5

Please sign in to comment.