From 5756e11fd83ae0a9257f6faefb0ef60bd31be1c1 Mon Sep 17 00:00:00 2001 From: Jerome Kieffer Date: Tue, 6 Jan 2026 13:40:34 +0100 Subject: [PATCH] Update documentation --- .gitignore | 2 +- doc/source/dahu.rst | 8 +- doc/source/installation.rst | 19 ++- pyproject.toml | 7 +- setup.py | 310 ------------------------------------ version.py | 6 +- 6 files changed, 22 insertions(+), 330 deletions(-) delete mode 100644 setup.py diff --git a/.gitignore b/.gitignore index ded6067..3a8c53b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -*.py[cod] +#*.py[cod] # C extensions *.so diff --git a/doc/source/dahu.rst b/doc/source/dahu.rst index 5bdf807..d94ed72 100644 --- a/doc/source/dahu.rst +++ b/doc/source/dahu.rst @@ -6,10 +6,10 @@ Dahu: online data analysis server The *dahu* server executes **jobs**: ------------------------------------ -* Each job lives in its own thread (yes, thread, not process, it the plugin's developper to ensure the work he is doing is GIL-compliant). -* Each job executes one plugin, provided by the plugin's developper (i.e. the scientist) -* The job de/serialises JSON strings coming from/returning to Tango -* Jobs are executed asynchronously, the request for calculation is answered instantaneously with a *jobid*. +* Each job lives in its own thread (yes, thread, not process, it the plugin's developer to ensure the work he is doing is GIL-compliant). +* Each job executes one plugin, provided by the plugin's developer (i.e. the scientist) +* The job (de-) serializes JSON strings coming from/returning to Tango +* Jobs are executed asynchronously, the request for calculation is answered instantaneously with a *jobid* (an integer, unique for the process). * The *jobid* can be used to poll the server for the status of the job or for manual synchronization (mind that Tango can time-out!). * When jobs are finished, the client is notified via Tango events about the status * Results can be retrieved after the job has finished. diff --git a/doc/source/installation.rst b/doc/source/installation.rst index a448b90..2faba0e 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -1,25 +1,28 @@ Installation of Dahu ==================== -Dahu is a Python (-3) project, the only dependency is `numpy` but `Tango` is needed for the server part. +Dahu is a Python project, the only dependency is `numpy` but `Tango` is needed for the server part. .. code-block:: shell - python setup.py build test bdist_wheel - pip install dist/dahu*.whl + cd dahu + python run_tests.py + pip wheel . + pip install dahu-*.whl Dahu can also be installed as debian package with automatic packaging from the `build-deb.sh` tool. -Documentation can be generated with `python setup.py build_doc`. +Documentation can be generated with `python build_doc.py`. -Devlopment of Dahu -================== + +Development of Dahu +=================== `Dahu` is an Open source project under MIT license available at: https://github.com/kif/dahu There is a minimal test-suite which ensures the dynamic loading works as expected. -The kernel of dahu is tested, but plugins are not. +The kernel of `dahu` is tested, but plugins are not. Development of plugins @@ -27,7 +30,7 @@ Development of plugins Plugins are regrouped into the `plugin` directory. There is one directory per beamline and several plugins per beamline. -Each beamline is independant so no interference are expected. +Each beamline is independent so no interference are expected. Dahu can be tested on plugins in an alternative directory using the `$DAHU_PLUGINS` environment variable. diff --git a/pyproject.toml b/pyproject.toml index a734713..45c1e60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = 'dahu' dynamic = ['version',] license = {file = 'LICENSE'} -requires-python = '>=3.7' +requires-python = '>=3.9' readme = 'README.rst' description = '"Python lightweight, plugin based, data analysis engine"' authors = [ @@ -24,13 +24,12 @@ classifiers = ["Development Status :: 3 - Alpha", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Cython", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Scientific/Engineering :: Physics", "Topic :: Software Development :: Libraries :: Python Modules", diff --git a/setup.py b/setup.py deleted file mode 100644 index 0231c24..0000000 --- a/setup.py +++ /dev/null @@ -1,310 +0,0 @@ -#!/usr/bin/env python3 -# coding: utf8 -# /*########################################################################## -# -# Copyright (c) 2013-2020 European Synchrotron Radiation Facility -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# ###########################################################################*/ - -""" -Data Analysis Highly tailored for Upbl09a -""" -__authors__ = ["Jérôme Kieffer", "Thomas Vincent"] -__contact__ = "Jerome.Kieffer@ESRF.eu" -__license__ = "MIT" -__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -__date__ = "23/06/2020" -__status__ = "development" - -import sys -import os -import glob -import logging -logger = logging.getLogger("dahu.setup") - -if sys.version_info[0] < 3: - raise SystemError("Freesas requires Python3 !") - -from numpy.distutils.misc_util import Configuration -try: - from setuptools import Command, setup - from setuptools.command.build_py import build_py as _build_py - from setuptools.command.sdist import sdist - logger.info("Use setuptools.setup") -except ImportError: - try: - from numpy.distutils.core import Command, setup - except ImportError: - from distutils.core import Command - from distutils.command.build_py import build_py as _build_py - from distutils.command.sdist import sdist - logger.info("Use distutils.core.setup") - -PROJECT = "dahu" -cmdclass = {} - - -def get_version(): - import version - return version.strictversion - - -def get_readme(): - dirname = os.path.dirname(os.path.abspath(__file__)) - with open(os.path.join(dirname, "README.rst"), "r") as fp: - long_description = fp.read() - return long_description - - -classifiers = ["Development Status :: 3 - Alpha", - "Environment :: Console", - "Environment :: MacOS X", - "Environment :: Win32 (MS Windows)", - "Environment :: X11 Applications :: Qt", - "Intended Audience :: Education", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", - "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)", - "Natural Language :: English", - "Operating System :: MacOS", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX", - "Programming Language :: Cython", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: Implementation :: CPython", - "Topic :: Scientific/Engineering :: Physics", - "Topic :: Software Development :: Libraries :: Python Modules", - ] - -# ########## # -# version.py # -# ########## # - - -class build_py(_build_py): - """ - Enhanced build_py which copies version.py to ._version.py - """ - - def find_package_modules(self, package, package_dir): - modules = _build_py.find_package_modules(self, package, package_dir) - if package == PROJECT: - modules.append((PROJECT, '_version', 'version.py')) - return modules - - -cmdclass['build_py'] = build_py - -######## -# Test # -######## - - -class PyTest(Command): - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - import subprocess - errno = subprocess.call([sys.executable, 'run_tests.py']) - if errno != 0: - raise SystemExit(errno) - - -cmdclass['test'] = PyTest - -# ################### # -# build_doc commandes # -# ################### # - -try: - import sphinx - import sphinx.util.console - sphinx.util.console.color_terminal = lambda: False - from sphinx.setup_command import BuildDoc -except ImportError: - sphinx = None -else: - - # i.e. if sphinx: - class build_doc(BuildDoc): - - def run(self): - # make sure the python path is pointing to the newly built - # code so that the documentation is built on this and not a - # previously installed version - - build = self.get_finalized_command('build') - sys.path.insert(0, os.path.abspath(build.build_lib)) - -# # Copy .ui files to the path: -# dst = os.path.join( -# os.path.abspath(build.build_lib), "silx", "gui") -# if not os.path.isdir(dst): -# os.makedirs(dst) -# for i in os.listdir("gui"): -# if i.endswith(".ui"): -# src = os.path.join("gui", i) -# idst = os.path.join(dst, i) -# if not os.path.exists(idst): -# shutil.copy(src, idst) - - # Build the Users Guide in HTML and TeX format - for builder in ('html', 'latex'): - self.builder = builder - self.builder_target_dir = os.path.join(self.build_dir, builder) - self.mkpath(self.builder_target_dir) - BuildDoc.run(self) - sys.path.pop(0) - - cmdclass['build_doc'] = build_doc - -# ############################# # -# numpy.distutils Configuration # -# ############################# # - - -def configuration(parent_package='', top_path=None): - """Recursive construction of package info to be used in setup(). - - See http://docs.scipy.org/doc/numpy/reference/distutils.html#numpy.distutils.misc_util.Configuration - """ # noqa - config = Configuration(None, parent_package, top_path) - config.set_options( - ignore_setup_xxx_py=True, - assume_default_configuration=True, - delegate_options_to_subpackages=True, - quiet=True) - config.add_subpackage(PROJECT) - return config - - -config = configuration() - -################################################################################ -# Debian source tree -################################################################################ - - -class sdist_debian(sdist): - """ - Tailor made sdist for debian - * remove auto-generated doc - * remove cython generated .c files - """ - - def prune_file_list(self): - sdist.prune_file_list(self) - to_remove = ["doc/build", "doc/pdf", "doc/html", "pylint", "epydoc"] - print("Removing files for debian") - for rm in to_remove: - self.filelist.exclude_pattern(pattern="*", anchor=False, prefix=rm) - - # this is for Cython files specifically: remove C & html files - search_root = os.path.dirname(os.path.abspath(__file__)) - for root, _, files in os.walk(search_root): - for afile in files: - if os.path.splitext(afile)[1].lower() == ".pyx": - base_file = os.path.join(root, afile)[len(search_root) + 1:-4] - self.filelist.exclude_pattern(pattern=base_file + ".c") - self.filelist.exclude_pattern(pattern=base_file + ".cpp") - self.filelist.exclude_pattern(pattern=base_file + ".html") - - def make_distribution(self): - self.prune_file_list() - sdist.make_distribution(self) - dest = self.archive_files[0] - dirname, basename = os.path.split(dest) - base, ext = os.path.splitext(basename) - while ext in [".zip", ".tar", ".bz2", ".gz", ".Z", ".lz", ".orig"]: - base, ext = os.path.splitext(base) - if ext: - dest = "".join((base, ext)) - else: - dest = base - sp = dest.split("-") - base = sp[:-1] - nr = sp[-1] - debian_arch = os.path.join(dirname, "-".join(base) + "_" + nr + ".orig.tar.gz") - os.rename(self.archive_files[0], debian_arch) - self.archive_files = [debian_arch] - print("Building debian .orig.tar.gz in %s" % self.archive_files[0]) - - -cmdclass['debian_src'] = sdist_debian - -# ##### # -# setup # -# ##### # - -setup_kwargs = config.todict() -script_files = glob.glob("scripts/*") -install_requires = ["numpy"] -setup_requires = ["numpy"] -extras_require = {"tango": ["pytango"]} -entry_points = {"console_scripts": ["dahu-server = dahu.app.server:main", - "dahu-register = dahu.app.register:main"]} - -plugins = ["dahu.plugins"] -plugin_dir = {"dahu": "dahu", - "dahu.test": "dahu/test", - "dahu.plugins": "plugins"} -for root, dirs, files in os.walk("plugins", topdown=True): - for name in dirs: - base = os.path.join(root, name) - if not os.path.isfile(os.path.join(base, "__init__.py")): - continue - fqn = "dahu." + base.replace(os.sep, ".") - plugins.append(fqn) - plugin_dir[fqn] = base - -setup_kwargs.update(name=PROJECT, - version=get_version(), - url="https://github.com/kif/dahu", - author="Jérôme Kieffer", - author_email="silx@esrf.fr", - classifiers=classifiers, - description="Python lightweight, plugin based, data analysis engine", - long_description=get_readme(), - install_requires=install_requires, - setup_requires=setup_requires, - extras_require=extras_require, - entry_points=entry_points, - cmdclass=cmdclass, - package_data={'silx.resources': [ - # Add here all resources files - 'gui/icons/*.png', - ]}, - zip_safe=False, - packages=["dahu", "dahu.app", "dahu.test"] + plugins, - package_dir=plugin_dir, - test_suite="test", - scripts=script_files, - ) - -setup(**setup_kwargs) diff --git a/version.py b/version.py index df605fc..13364f1 100755 --- a/version.py +++ b/version.py @@ -50,7 +50,7 @@ __contact__ = "Jerome.Kieffer@ESRF.eu" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -__date__ = "13/03/2025" +__date__ = "06/01/2026" __status__ = "production" __docformat__ = 'restructuredtext' __all__ = ["date", "version_info", "strictversion", "hexversion", "debianversion", @@ -63,8 +63,8 @@ "rc": 13, "final": 15} -MAJOR = 2025 -MINOR = 4 +MAJOR = 2026 +MINOR = 1 MICRO = 0 RELEV = "dev" # <16 SERIAL = 0 # <16