diff --git a/hatch_build.py b/hatch_build.py new file mode 100644 index 0000000..a0208ee --- /dev/null +++ b/hatch_build.py @@ -0,0 +1,10 @@ +from pathlib import Path +from hatchling.metadata.plugin.interface import MetadataHookInterface +from pymodaq_utils.resources.hatch_build_plugins import update_metadata_from_toml + +here = Path(__file__).absolute().parent + + +class PluginInfoTomlHook(MetadataHookInterface): + def update(self, metadata: dict) -> None: + update_metadata_from_toml(metadata, here) diff --git a/plugin_info.toml b/plugin_info.toml deleted file mode 100644 index 7d64140..0000000 --- a/plugin_info.toml +++ /dev/null @@ -1,24 +0,0 @@ -## To modify by developer(s) of the plugin - -[plugin-info] -SHORT_PLUGIN_NAME = 'standing_wave' #to be modified, for instance daqmx then rename the module name: -# (pymodaq_plugins_template become pymodaq_plugins_daqmx for instance) - -package-url = 'https://github.com/PyMoDAQ/pymodaq_plugins_standing_wave' #to modify -description = 'some word about your plugin' - -author = 'Sebastien J. Weber' -author-email = 'sebastien.weber@cnrs.fr' -license = 'MIT' - -[plugin-install] -#packages required for your plugin: -packages-required = ['pymodaq>=4.1.0'] - -[features] # defines the plugin features contained into this plugin -instruments = true # true if plugin contains instrument classes (else false, notice the lowercase for toml files) -extensions = false # true if plugins contains dashboard extensions -models = false # true if plugins contains pid models or other models (optimisation...) -h5exporters = false # true if plugin contains custom h5 file exporters -scanners = false # true if plugin contains custom scan layout (daq_scan extensions) - diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5e7a961 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,65 @@ +[features] # defines the plugin features contained into this plugin +instruments = true # true if plugin contains instrument classes (else false, notice the lowercase for toml files) +extensions = false # true if plugins contains dashboard extensions +models = false # true if plugins contains pid models +h5exporters = false # true if plugin contains custom h5 file exporters +scanners = false # true if plugin contains custom scan layout (daq_scan extensions) + +[urls] +package-url = 'https://github.com/PyMoDAQ/pymodaq_plugins_standing_wave' #todo modify url by your plugin url + +[project] +name = "pymodaq_plugins_standing_wave" #todo modify template by your plugin short name +description = 'some word about your plugin' +dependencies = [ + "pymodaq>=5.0.0", + "pymodaq_plugins_daqmx", + "pymodaq_plugins_physik_instrumente" + #todo: list here all dependencies your package may have +] + +authors = [ + {name = "Weber Sebastien", email = "sebastien.weber@cnrs.fr"}, + #todo: list here all authors of your plugin +] +maintainers = [ + {name = "Weber Sebastien", email = "sebastien.weber@cnrs.fr"}, + #todo: list here all maintainers of your plugin +] + +# nottodo: leave everything below as is! + +dynamic = ["version", "urls", "entry-points"] +readme = "README.rst" +license = { file="LICENSE" } +requires-python = ">=3.8" + +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Scientific/Engineering :: Human Machine Interfaces", + "Topic :: Scientific/Engineering :: Visualization", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Software Development :: User Interfaces", +] + +[build-system] +requires = [ + "hatchling>=1.9.0", + "hatch-vcs", "toml", + "pymodaq_utils>=0.0.6", +] +build-backend = "hatchling.build" + +[tool.hatch.metadata.hooks.custom] + +[tool.hatch.version] +source = "vcs" + diff --git a/setup.py b/setup.py deleted file mode 100644 index f9d5474..0000000 --- a/setup.py +++ /dev/null @@ -1,4 +0,0 @@ -from pymodaq.resources.setup_plugin import setup -from pathlib import Path - -setup(Path(__file__).parent) \ No newline at end of file diff --git a/src/pymodaq_plugins_standing_wave/__init__.py b/src/pymodaq_plugins_standing_wave/__init__.py index ca051e5..cd4e7c1 100644 --- a/src/pymodaq_plugins_standing_wave/__init__.py +++ b/src/pymodaq_plugins_standing_wave/__init__.py @@ -1,8 +1,10 @@ from pathlib import Path -from pymodaq.utils.logger import set_logger # to be imported by other modules. - from .utils import Config -config = Config() +from pymodaq_utils.utils import get_version, PackageNotFoundError +from pymodaq_utils.logger import set_logger, get_module_name -with open(str(Path(__file__).parent.joinpath('resources/VERSION')), 'r') as fvers: - __version__ = fvers.read().strip() +config = Config() +try: + __version__ = get_version(__package__) +except PackageNotFoundError: + __version__ = '0.0.0dev' diff --git a/src/pymodaq_plugins_standing_wave/daq_viewer_plugins/plugins_1D/daq_1Dviewer_SW_GrabMove.py b/src/pymodaq_plugins_standing_wave/daq_viewer_plugins/plugins_1D/daq_1Dviewer_SW_GrabMove.py index 622290c..7afc1fe 100644 --- a/src/pymodaq_plugins_standing_wave/daq_viewer_plugins/plugins_1D/daq_1Dviewer_SW_GrabMove.py +++ b/src/pymodaq_plugins_standing_wave/daq_viewer_plugins/plugins_1D/daq_1Dviewer_SW_GrabMove.py @@ -49,15 +49,15 @@ class DAQ_1DViewer_SW_GrabMove(DAQ_Viewer_base): {'title': 'DAQmx', 'name': 'daqmx_params', 'type': 'group', 'children': [ {'title': 'AI Channel:', 'name': 'ai_channel', 'type': 'list', - 'values': DAQmx.get_NIDAQ_channels(source_type='Analog_Input'), + 'limits': DAQmx.get_NIDAQ_channels(source_type='Analog_Input'), 'value': f'{device_ai}/{channel_ai}'}, {'title': 'Clock Channel:', 'name': 'clock_channel', 'type': 'list', - 'values': DAQmx.get_NIDAQ_channels(source_type='Terminals'), + 'limits': DAQmx.get_NIDAQ_channels(source_type='Terminals'), 'value': f'/{device_ai}/{clock_ai_terminal}'}, {'title': 'Clock rate:', 'name': 'clock_rate', 'type': 'int', 'value': config('daqmx', 'clock_rate')}, {'title': 'Trigger Channel:', 'name': 'trigger_channel', 'type': 'list', - 'values': DAQmx.get_NIDAQ_channels(source_type='Terminals'), + 'limits': DAQmx.get_NIDAQ_channels(source_type='Terminals'), 'value': f'/{device_ai}/{trigger_ai_terminal}'}, {'title': 'Enable Trigger:', 'name': 'trigger_enabled', 'type': 'bool', 'value': config('daqmx', 'trigger_enabled')}, diff --git a/src/pymodaq_plugins_standing_wave/resources/VERSION b/src/pymodaq_plugins_standing_wave/resources/VERSION deleted file mode 100644 index 8a9ecc2..0000000 --- a/src/pymodaq_plugins_standing_wave/resources/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.0.1 \ No newline at end of file diff --git a/src/pymodaq_plugins_standing_wave/resources/config_template.toml b/src/pymodaq_plugins_standing_wave/resources/config_template.toml index 6dc9735..8ba0e71 100644 --- a/src/pymodaq_plugins_standing_wave/resources/config_template.toml +++ b/src/pymodaq_plugins_standing_wave/resources/config_template.toml @@ -8,7 +8,7 @@ npts = 200 rate= 200 [daqmx] - device_ai = 'Dev3' + device_ai = 'Dev1' channel_ai = 'ai0' clock_ai_terminal = 'PFI0' clock_rate = 20000