From 28b6a969b0e7f3662cee366342f08bf67d97c8c2 Mon Sep 17 00:00:00 2001 From: Sander Willems Date: Mon, 21 Nov 2022 16:43:45 +0100 Subject: [PATCH 1/7] =?UTF-8?q?Bump=20version:=201.0.6=20=E2=86=92=201.0.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- alphatims/__init__.py | 2 +- misc/bumpversion.cfg | 2 +- misc/one_click_linux/control | 2 +- misc/one_click_linux/create_installer_linux.sh | 2 +- misc/one_click_macos/Info.plist | 4 ++-- misc/one_click_macos/create_installer_macos.sh | 6 +++--- misc/one_click_macos/distribution.xml | 2 +- misc/one_click_windows/alphatims_innoinstaller.iss | 2 +- misc/one_click_windows/create_installer_windows.bat | 2 +- misc/one_click_windows/create_installer_windows.sh | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/alphatims/__init__.py b/alphatims/__init__.py index b8804bb1..944df9fb 100755 --- a/alphatims/__init__.py +++ b/alphatims/__init__.py @@ -2,7 +2,7 @@ __project__ = "alphatims" -__version__ = "1.0.6" +__version__ = "1.0.7" __license__ = "Apache" __description__ = "A Python package to index Bruker TimsTOF raw data for fast and easy accession and visualization" __author__ = "Sander Willems, Eugenia Voytik" diff --git a/misc/bumpversion.cfg b/misc/bumpversion.cfg index f31aaa1c..1ae7d6e6 100644 --- a/misc/bumpversion.cfg +++ b/misc/bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.0.6 +current_version = 1.0.7 commit = True tag = False parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? diff --git a/misc/one_click_linux/control b/misc/one_click_linux/control index de0d11f0..9fec6886 100644 --- a/misc/one_click_linux/control +++ b/misc/one_click_linux/control @@ -1,5 +1,5 @@ Package: AlphaTims -Version: 1.0.6 +Version: 1.0.7 Architecture: all Maintainer: Mann Labs Description: AlphaTims GUI diff --git a/misc/one_click_linux/create_installer_linux.sh b/misc/one_click_linux/create_installer_linux.sh index 19a4f119..881b8215 100644 --- a/misc/one_click_linux/create_installer_linux.sh +++ b/misc/one_click_linux/create_installer_linux.sh @@ -12,7 +12,7 @@ rm -rf dist rm -rf build python setup.py sdist bdist_wheel cd misc/one_click_linux -pip install "../../dist/alphatims-1.0.6-py3-none-any.whl[plotting-stable,stable,legacy-stable]" +pip install "../../dist/alphatims-1.0.7-py3-none-any.whl[plotting-stable,stable,legacy-stable]" pip install pyinstaller==5.6.2 pyinstaller ../pyinstaller/alphatims.spec -y conda deactivate diff --git a/misc/one_click_macos/Info.plist b/misc/one_click_macos/Info.plist index f4a4f647..26971cec 100644 --- a/misc/one_click_macos/Info.plist +++ b/misc/one_click_macos/Info.plist @@ -9,9 +9,9 @@ CFBundleIconFile alpha_logo.icns CFBundleIdentifier - alphatims.1.0.6 + alphatims.1.0.7 CFBundleShortVersionString - 1.0.6 + 1.0.7 CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/misc/one_click_macos/create_installer_macos.sh b/misc/one_click_macos/create_installer_macos.sh index 6e01f4f9..6e4615b7 100644 --- a/misc/one_click_macos/create_installer_macos.sh +++ b/misc/one_click_macos/create_installer_macos.sh @@ -17,7 +17,7 @@ rm -rf build python setup.py sdist bdist_wheel cd misc/one_click_macos pip install pyinstaller==5.6.2 -pip install "../../dist/alphatims-1.0.6-py3-none-any.whl[plotting-stable,stable,legacy-stable]" +pip install "../../dist/alphatims-1.0.7-py3-none-any.whl[plotting-stable,stable,legacy-stable]" conda list pyinstaller ../pyinstaller/alphatims.spec -y conda deactivate @@ -34,7 +34,7 @@ if false; then # https://scriptingosx.com/2019/09/notarize-a-command-line-tool/ for f in $(find dist/alphatims -name '*.so' -or -name '*.dylib'); do codesign --sign "Developer ID Application: Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (7QSY5527AQ)" $f; done codesign --sign "Developer ID Application: Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (7QSY5527AQ)" dist/alphatims/Contents/MacOS/alphatims_gui --force --options=runtime --entitlements entitlements.xml - pkgbuild --root dist/alphatims --identifier de.mpg.biochem.alphatims.app --version 1.0.6 --install-location /Applications/AlphaTims.app --scripts scripts alphatims.pkg --sign "Developer ID Installer: Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (7QSY5527AQ)" + pkgbuild --root dist/alphatims --identifier de.mpg.biochem.alphatims.app --version 1.0.7 --install-location /Applications/AlphaTims.app --scripts scripts alphatims.pkg --sign "Developer ID Installer: Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (7QSY5527AQ)" productbuild --distribution distribution.xml --resources Resources --package-path alphatims.pkg dist/alphatims_gui_installer_macos.pkg --sign "Developer ID Installer: Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (7QSY5527AQ)" requestUUID=$(xcrun altool --notarize-app --primary-bundle-id "de.mpg.biochem.alphatims.app" --username "willems@biochem.mpg.de" --password "@keychain:Alphatims-develop" --asc-provider 7QSY5527AQ --file dist/alphatims_gui_installer_macos.pkg 2>&1 | awk '/RequestUUID/ { print $NF; }') request_status="in progress" @@ -46,6 +46,6 @@ if false; then xcrun altool --notarization-info "$requestUUID" --username "willems@biochem.mpg.de" --password "@keychain:Alphatims-develop" xcrun stapler staple dist/alphatims_gui_installer_macos.pkg else - pkgbuild --root dist/alphatims --identifier de.mpg.biochem.alphatims.app --version 1.0.6 --install-location /Applications/AlphaTims.app --scripts scripts alphatims.pkg + pkgbuild --root dist/alphatims --identifier de.mpg.biochem.alphatims.app --version 1.0.7 --install-location /Applications/AlphaTims.app --scripts scripts alphatims.pkg productbuild --distribution distribution.xml --resources Resources --package-path alphatims.pkg dist/alphatims_gui_installer_macos.pkg fi diff --git a/misc/one_click_macos/distribution.xml b/misc/one_click_macos/distribution.xml index 4b6cbaf9..96fba2e2 100755 --- a/misc/one_click_macos/distribution.xml +++ b/misc/one_click_macos/distribution.xml @@ -1,6 +1,6 @@ - AlphaTims 1.0.6 + AlphaTims 1.0.7 diff --git a/misc/one_click_windows/alphatims_innoinstaller.iss b/misc/one_click_windows/alphatims_innoinstaller.iss index d9e246d5..bd238756 100644 --- a/misc/one_click_windows/alphatims_innoinstaller.iss +++ b/misc/one_click_windows/alphatims_innoinstaller.iss @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "AlphaTims" -#define MyAppVersion "1.0.6" +#define MyAppVersion "1.0.7" #define MyAppPublisher "Max Planck Institute of Biochemistry, Mann department" #define MyAppURL "https://github.com/MannLabs/alphatims" #define MyAppExeName "alphatims_gui.exe" diff --git a/misc/one_click_windows/create_installer_windows.bat b/misc/one_click_windows/create_installer_windows.bat index 1f6a45a3..4b26db9b 100644 --- a/misc/one_click_windows/create_installer_windows.bat +++ b/misc/one_click_windows/create_installer_windows.bat @@ -15,7 +15,7 @@ call rmdir dist /s /q call rmdir build /s /q call python setup.py sdist bdist_wheel call cd misc/one_click_windows -call pip install "../../dist/alphatims-1.0.6-py3-none-any.whl[plotting-stable,stable,legacy-stable]" +call pip install "../../dist/alphatims-1.0.7-py3-none-any.whl[plotting-stable,stable,legacy-stable]" call pip install pyinstaller==4.10 call pyinstaller ../pyinstaller/alphatims.spec -y call conda deactivate diff --git a/misc/one_click_windows/create_installer_windows.sh b/misc/one_click_windows/create_installer_windows.sh index 9e2db2b7..8e2405ed 100644 --- a/misc/one_click_windows/create_installer_windows.sh +++ b/misc/one_click_windows/create_installer_windows.sh @@ -7,7 +7,7 @@ rm -rf dist rm -rf build python setup.py sdist bdist_wheel cd misc/one_click_windows -pip install "../../dist/alphatims-1.0.6-py3-none-any.whl[plotting-stable,stable,legacy-stable]" +pip install "../../dist/alphatims-1.0.7-py3-none-any.whl[plotting-stable,stable,legacy-stable]" pip install pyinstaller==5.6.2 # TODO https://stackoverflow.com/questions/54175042/python-3-7-anaconda-environment-import-ssl-dll-load-fail-error/60405693#60405693 pyinstaller ../pyinstaller/alphatims.spec -y From c96512b24aa61f206eaba74906f180c834be089b Mon Sep 17 00:00:00 2001 From: Sander Willems Date: Wed, 7 Dec 2022 12:12:38 +0100 Subject: [PATCH 2/7] FIX: tof index bug as found by guoci --- alphatims/bruker.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/alphatims/bruker.py b/alphatims/bruker.py index fa6b254e..cb15230f 100644 --- a/alphatims/bruker.py +++ b/alphatims/bruker.py @@ -293,7 +293,10 @@ def parse_decompressed_bruker_binary_type2(decompressed_bytes: bytes) -> tuple: buffer = np.frombuffer(temp.reshape(4, -1).T.flatten(), dtype=np.uint32) scan_count = buffer[0] scan_indices = buffer[:scan_count].copy() // 2 - scan_indices[0] = 0 + intensities = buffer[scan_count + 1::2] + last_scan = len(intensities) - np.sum(scan_indices[1:]) + scan_indices[:-1] = scan_indices[1:] + scan_indices[-1] = last_scan tof_indices = buffer[scan_count::2].copy() index = 0 for size in scan_indices: @@ -302,10 +305,6 @@ def parse_decompressed_bruker_binary_type2(decompressed_bytes: bytes) -> tuple: current_sum += tof_indices[index] tof_indices[index] = current_sum index += 1 - intensities = buffer[scan_count + 1::2] - last_scan = len(intensities) - np.sum(scan_indices[1:]) - scan_indices[:-1] = scan_indices[1:] - scan_indices[-1] = last_scan return scan_indices, tof_indices - 1, intensities From 84f5d75941e3c87eb52c0b030b1b5d591ff26cd1 Mon Sep 17 00:00:00 2001 From: Sander Willems Date: Wed, 7 Dec 2022 12:14:16 +0100 Subject: [PATCH 3/7] FEAT: allow colormap setting for dataframe plotting --- alphatims/plotting.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/alphatims/plotting.py b/alphatims/plotting.py index de8e970c..7500666f 100644 --- a/alphatims/plotting.py +++ b/alphatims/plotting.py @@ -136,6 +136,7 @@ def heatmap( width: int = 1000, height: int = 320, rescale_to_minutes: bool = True, + cmap=colorcet.fire, **kwargs, ): """Create a scatterplot / heatmap for a dataframe. @@ -234,11 +235,11 @@ def heatmap( # df[x_dimension].max() # ), title=f'Heatmap - {title}', - aggregator='sum', + aggregator='sum' if map==colorcet.fire else None, # tools=[hover], datashade=True, dynspread=True, - cmap=colorcet.fire, + cmap=cmap, # nonselection_color='green', # selection_color='blue', # color="white", From 6d157d52b54dee75eff97eb12df218e24f5633be Mon Sep 17 00:00:00 2001 From: Sander Willems Date: Thu, 9 Feb 2023 12:00:03 +0100 Subject: [PATCH 4/7] FEAT: created compiling module for jit classes --- alphatims/compiling.py | 243 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 243 insertions(+) create mode 100644 alphatims/compiling.py diff --git a/alphatims/compiling.py b/alphatims/compiling.py new file mode 100644 index 00000000..b9360e41 --- /dev/null +++ b/alphatims/compiling.py @@ -0,0 +1,243 @@ +# builtin +import ast +import textwrap +import inspect +import types +import weakref + +# external +import numba +import pandas as pd +import numpy as np + + +def precompile_njit_functions_from_object(object_): + if not is_regular_object_with_dict(object_): + return + create_njit_module_for_object(object_) + for func in iterate_over_callables_from_object(object_): + try: + tree = get_source_tree_from_callable(func) + except OSError: + pass + else: + if tree_has_decorator_containing_name(tree, "njit"): + add_njit_function_to_object_njit_module(object_, func, tree) + overwrite_object_function_with_njit_function(object_, func) + + +def is_regular_object_with_dict(object_): + if not hasattr(object_, "__dict__"): + return False + if isinstance(object_, numba.core.registry.CPUDispatcher): + return False + return True + + +def create_njit_module_for_object(object_): + module = create_module(object_) + module.__dict__.update(inspect.getmodule(object_).__dict__) + module.self = module + object.__setattr__(object_, "__njit__", module) + + +def create_module(x): + if has_njit_module(x): + return x.__njit__ + if is_pandas_dataframe(x): + return create_module_from_dataframe(x) + elif is_regular_object_with_dict(x): + return create_module_from_object(x) + else: + return x + + +def is_module(x): + return hasattr(x, "__njit__") + + +def has_njit_module(x): + return isinstance(x, types.ModuleType) + + +def is_pandas_dataframe(x): + return isinstance(x, pd.DataFrame) + + +def create_module_from_dataframe(df): + module = types.ModuleType(f"{df.__class__}_{id(df)}") + for column in df.columns: + module.__dict__[column] = np.array(df[column].values, copy=False) + for key, value in df.__dict__.items(): + if not key.startswith("_"): + module.__dict__[key] = create_module(value) + return module + + +def create_module_from_object(object_): + module = types.ModuleType(f"{object_.__class__}_{id(object_)}") + for key, value in object_.__dict__.items(): + if not key.startswith("__"): + module.__dict__[key] = create_module(value) + return module + + +def iterate_over_callables_from_object(object_): + for key in list(dir(object_)): + if key.startswith("__"): + continue + potential_func = eval(f"object_.{key}") + if callable(potential_func): + yield potential_func + + +def get_source_tree_from_callable(func): + src = inspect.getsource(func) + src = textwrap.dedent(src) + return ast.parse(src) + + +def tree_has_decorator_containing_name(tree, name): + for decorator in tree.body[0].decorator_list: + if decorator_contains(decorator, name): + return True + return False + + +def decorator_contains(decorator, name): + # TODO: Should be properly parsed! + if name in ast.unparse(decorator): + return True + return False + + +def add_njit_function_to_object_njit_module(object_, func, tree): + src = create_src_without_self_and_decorators_from_function_tree(tree) + exec(src, object_.__njit__.__dict__) + nogil = tree_has_decorator_containing_name(tree, "nogil") + func_ = numba.njit(nogil=nogil)(object_.__njit__.__dict__[func.__name__]) + src = f"object.__setattr__(object_.__njit__, '{func.__name__}', func_)" + exec(src) + + +def create_src_without_self_and_decorators_from_function_tree(tree): + # TODO: removes the nogil decorator as well! + origonal_decorators = tree.body[0].decorator_list + origonal_args = tree.body[0].args.args + tree.body[0].decorator_list = [] + tree.body[0].args.args = tree.body[0].args.args[1:] + src = ast.unparse(tree) + tree.body[0].decorator_list = origonal_decorators + tree.body[0].args.args = origonal_args + return src + + +def overwrite_object_function_with_njit_function(object_, func): + src = f"object.__setattr__(object_, '{func.__name__}', object_.__njit__.{func.__name__})" + exec(src) + + +def njit(*args, **kwargs): + return numba.njit(*args, **kwargs) + + +# def njit_class(_func=None, dataclass=False, **decorator_kwargs): +# import functools +# def wrapper(_func): +# @functools.wraps(_func) +# def inner_func(*func_args, **func_kwargs): +# _object = _func(*func_args, **func_kwargs) +# precompile_njit_functions_from_object(_object) +# return _object +# return inner_func +# if _func is None: +# return wrapper +# else: +# return wrapper(_func) + + +def njit_class(_cls=None, njit=True): + def wrapper(_cls): + def __blank_post_init__(self): + if hasattr(super(self.__class__.__mro__[self.__class_index__], self), "__post_init__"): + super(self.__class__.__mro__[self.__class_index__], self).__post_init__() + def __post_init__(self): + if not hasattr(self, "__class_index__"): + object.__setattr__(self, "__class_index__", -1) + object.__setattr__(self, "__class_index__", self.__class_index__ + 1) + self.__class__.__mro__[self.__class_index__].__original_post_init__(self) + object.__setattr__(self, "__class_index__", self.__class_index__ - 1) + if self.__class_index__ == -1: + if njit and not hasattr(self, "__njit__"): + self.precompile_njit_functions_from_object() + del self.__dict__["__class_index__"] + _cls.precompile_njit_functions_from_object = precompile_njit_functions_from_object + for _super_cls in _cls.__mro__[:-1][::-1]: + has_post_init = ("__post_init__" in _super_cls.__dict__) + if not has_post_init: + _super_cls.__post_init__ = __blank_post_init__ + has_original_post_init = ("__original_post_init__" in _super_cls.__dict__) + if not has_original_post_init: + _super_cls.__original_post_init__ = _super_cls.__post_init__ + _super_cls.__post_init__ = __post_init__ + return _cls + if _cls is None: + return wrapper + else: + return wrapper(_cls) + + + +# def njit_class(_cls=None, dataclass=False, njit=True, hdf=True, **decorator_kwargs): +# import functools +# def wrapper(_cls): +# def __blank_post_init__(self): +# if hasattr(super(self.__class__.__mro__[self.__class_index__], self), "__post_init__"): +# super(self.__class__.__mro__[self.__class_index__], self).__post_init__() +# def __post_init__(self): +# if not hasattr(self, "__class_index__"): +# object.__setattr__(self, "__class_index__", -1) +# object.__setattr__(self, "__class_index__", self.__class_index__ + 1) +# self.__class__.__mro__[self.__class_index__].__original_post_init__(self) +# object.__setattr__(self, "__class_index__", self.__class_index__ - 1) +# if self.__class_index__ == -1: +# if njit and not hasattr(self, "__njit__"): +# tdf2ms2.utils.compiling.precompile_njit_functions_from_object(self) +# if hdf and not hasattr(self, "__hdf__"): +# save_to_hdf(self) +# del self.__dict__["__class_index__"] +# for _super_cls in _cls.__mro__[:-1][::-1]: +# has_post_init = ("__post_init__" in _super_cls.__dict__) +# if not has_post_init: +# _super_cls.__post_init__ = __blank_post_init__ +# has_original_post_init = ("__original_post_init__" in _super_cls.__dict__) +# if not has_original_post_init: +# _super_cls.__original_post_init__ = _super_cls.__post_init__ +# _super_cls.__post_init__ = __post_init__ +# return dataclasses.dataclass(**decorator_kwargs)(_cls) +# if _cls is None: +# return wrapper +# else: +# return wrapper(_cls) + + +# def save_to_hdf(self, file_name=None): +# if file_name is None: +# file_name = f"sandbox/{hash(self)}.hdf" +# object.__setattr__(self, "__hdf__", file_name) +# print(f"Saving object results to {file_name}.") +# import tdf2ms2.utils.hdf +# import inspect +# hdf = tdf2ms2.utils.hdf.HDF_File( +# file_name, +# read_only=False, +# truncate=True, +# ) +# for key, value in self.__dict__.items(): +# if not callable(value): +# if hasattr(value, "__hdf__"): +# hdf.__setattr__(key, value.__hdf__) +# elif inspect.ismodule(value): +# continue +# else: +# hdf.__setattr__(key, value) From acf02531dfb29d981943746242575011a18ff1b6 Mon Sep 17 00:00:00 2001 From: Sander Willems Date: Thu, 9 Feb 2023 12:00:28 +0100 Subject: [PATCH 5/7] FEAT: made an njit class as wrapper for dia_data --- alphatims/dia_data.py | 69 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 alphatims/dia_data.py diff --git a/alphatims/dia_data.py b/alphatims/dia_data.py new file mode 100644 index 00000000..37b16346 --- /dev/null +++ b/alphatims/dia_data.py @@ -0,0 +1,69 @@ +# builtin +import os +import dataclasses + +# external +import alphatims.bruker +import numpy as np + +# local +import alphatims.compiling + + +@alphatims.compiling.njit_class +@dataclasses.dataclass(kw_only=True, frozen=True) +class DiaData: + + file_name: str = dataclasses.field(repr=False) + sample_name: str = dataclasses.field(init=False) + + def __init__( + self, + *, + dia_data: alphatims.bruker.TimsTOF, + ): + file_name = self.parse_file_name(dia_data.bruker_d_folder_name) + object.__setattr__(self, "cycle", dia_data._cycle) + object.__setattr__(self, "im_values", dia_data._mobility_values) + object.__setattr__(self, "rt_values", dia_data._rt_values) + object.__setattr__(self, "mz_values", dia_data._mz_values) + object.__setattr__(self, "frames", dia_data._frames) + object.__setattr__(self, "fragment_frames", dia_data._fragment_frames) + object.__setattr__(self, "zeroth_frame", dia_data._zeroth_frame) + object.__setattr__(self, "tof_indptr", dia_data._push_indptr) + object.__setattr__(self, "tof_indices", dia_data._tof_indices) + object.__setattr__( + self, + "intensity_values", + dia_data._intensity_values.astype(np.float32) + ) + object.__setattr__(self, "as_dataframe", dia_data.as_dataframe) + object.__setattr__(self, "bin_intensities", dia_data.bin_intensities) + object.__setattr__(self, "_dia_data", dia_data) + + root_directory = os.path.basename(file_name) + sample_name = '.'.join( + os.path.basename(file_name).split('.')[:-1] + ) + object.__setattr__(self, "file_name", file_name) + object.__setattr__(self, "sample_name", sample_name) + object.__setattr__(self, "directory", root_directory) + + def __getitem__(self, keys): + return self._dia_data[keys] + + @staticmethod + def parse_file_name(file_name): + file_name = file_name.strip() + while file_name[-1] in ["'", '"']: + file_name = file_name[:-1] + while file_name[0] in ["'", '"']: + file_name = file_name[1:] + if not file_name.endswith(".d"): + raise ValueError( + f"File {file_name} is not a valid Bruker .d file." + ) + return file_name + + def __len__(self): + return self.size From be785e062dce1ab3cca8cd4d0b88af8416fbf363 Mon Sep 17 00:00:00 2001 From: Sander Willems Date: Thu, 9 Feb 2023 12:03:20 +0100 Subject: [PATCH 6/7] FEAT: shoe help per default if no args are given in cli --- alphatims/cli.py | 47 +++++++++++++++++------------------------------ 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/alphatims/cli.py b/alphatims/cli.py index 8a4f38ad..a9332a68 100644 --- a/alphatims/cli.py +++ b/alphatims/cli.py @@ -256,7 +256,11 @@ def detect(**kwargs): pass -@export.command("hdf", help="Export BRUKER_RAW_DATA as hdf file.") +@export.command( + "hdf", + help="Export BRUKER_RAW_DATA as hdf file.", + no_args_is_help=True, +) @cli_option("bruker_raw_data", as_argument=True) @cli_option("disable_overwrite") @cli_option("enable_compression") @@ -285,7 +289,11 @@ def export_hdf(**kwargs): ) -@export.command("mgf", help="Export BRUKER_RAW_DATA as (profile) mgf file.") +@export.command( + "mgf", + help="Export BRUKER_RAW_DATA as (profile) mgf file.", + no_args_is_help=True, +) @cli_option("bruker_raw_data", as_argument=True) @cli_option("keep_n_most_abundant_peaks") @cli_option("centroiding_window") @@ -315,7 +323,8 @@ def export_mgf(**kwargs): @export.command( "selection", - help="Load a BRUKER_RAW_DATA and select a data slice for export." + help="Load a BRUKER_RAW_DATA and select a data slice for export.", + no_args_is_help=True, ) @cli_option("bruker_raw_data", as_argument=True) @cli_option("ion_type") @@ -482,7 +491,11 @@ def export_selection(**kwargs): hv.save(plot, f"{output_file_name_base}.png", fmt="png") -@detect.command("ions", help="Detect ions (NotImplemented yet).") +@detect.command( + "ions", + help="Detect ions (NotImplemented yet).", + no_args_is_help=True, +) @cli_option("bruker_raw_data", as_argument=True) @cli_option("output_folder") @cli_option("log_file") @@ -493,29 +506,3 @@ def export_selection(**kwargs): def detect_ions(**kwargs): with parse_cli_settings("detect ions", **kwargs) as parameters: raise NotImplementedError - - -@detect.command("features", help="Detect features (NotImplemented yet).") -@cli_option("bruker_raw_data", as_argument=True) -@cli_option("output_folder") -@cli_option("log_file") -@cli_option("threads") -@cli_option("disable_log_stream") -@cli_option("parameter_file") -@cli_option("export_parameters") -def detect_features(**kwargs): - with parse_cli_settings("detect features", **kwargs) as parameters: - raise NotImplementedError - - -@detect.command("analytes", help="Detect analytes (NotImplemented yet).") -@cli_option("bruker_raw_data", as_argument=True) -@cli_option("output_folder") -@cli_option("log_file") -@cli_option("threads") -@cli_option("disable_log_stream") -@cli_option("parameter_file") -@cli_option("export_parameters") -def detect_analytes(**kwargs): - with parse_cli_settings("detect analytes", **kwargs) as parameters: - raise NotImplementedError From e23e16f7578517197e6eef883ba0342901fe0e4f Mon Sep 17 00:00:00 2001 From: Sander Willems Date: Thu, 9 Feb 2023 12:14:20 +0100 Subject: [PATCH 7/7] FIX: stable requirement updates --- requirements/requirements.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index af0842d8..fbc99b0a 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,7 +1,7 @@ -h5py==3.2.1 -numba==0.53.1 -pandas==1.4.2 -tqdm==4.64.0 -pyzstd==0.15.2 -psutil==5.9.0 -click==8.0.1 +click==8.1.3 +h5py==3.8.0 +numba==0.56.4 +pandas==1.5.3 +psutil==5.9.4 +pyzstd==0.15.3 +tqdm==4.64.1