diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 55a5e501..9eba508f 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -40,7 +40,7 @@ jobs: id: cache-lfs uses: actions/cache@v4 with: - path: test/data/reflectivity_ui-data/ + path: test/data/quicknxs-data/ key: submodule-${{ env.SUBMODULE_KEY }} - name: Pull LFS files for the submodule @@ -50,7 +50,7 @@ jobs: - name: Unit test with code coverage run: | # run tests requiring git lfs (may need to switch to a self-hosted runner) - xvfb-run -a python -m pytest -vv --cov=reflectivity_ui --cov-report=xml --cov-report=term + xvfb-run -a python -m pytest -vv --cov=quicknxs --cov-report=xml --cov-report=term - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 @@ -61,12 +61,12 @@ jobs: - name: Build Wheel run: | python -m build --wheel --no-isolation - check-wheel-contents dist/reflectivity_ui-*.whl + check-wheel-contents dist/quicknxs-*.whl - name: Build Conda package run: | conda mambabuild --output-folder . . -c mantid - conda verify noarch/reflectivity_ui-*.tar.bz2 + conda verify noarch/quicknxs-*.tar.bz2 - name: Deploy to Anaconda if: startsWith(github.ref, 'refs/tags/v') @@ -80,7 +80,7 @@ jobs: if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi if [ "${IS_DEV}" = "true" ]; then CONDA_LABEL="dev"; fi echo pushing ${{ github.ref }} with label $CONDA_LABEL - anaconda upload --label $CONDA_LABEL noarch/reflectivity_ui-*.tar.bz2 + anaconda upload --label $CONDA_LABEL noarch/quicknxs-*.tar.bz2 trigger-deploy: runs-on: ubuntu-22.04 diff --git a/.gitmodules b/.gitmodules index d3215fd3..06495cd5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "test/data/reflectivity_ui-data"] - path = test/data/reflectivity_ui-data - url = https://code.ornl.gov/sns-hfir-scse/infrastructure/test-data/reflectivity_ui-data.git +[submodule "test/data/quicknxs-data"] + path = test/data/quicknxs-data + url = https://code.ornl.gov/sns-hfir-scse/infrastructure/test-data/quicknxs-data.git diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 29f0af53..d88fa0bc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ # File introduces automated checks triggered on git events # to enable run `pip install pre-commit && pre-commit install` -exclude: ^reflectivity_ui/interfaces/generated/ +exclude: ^quicknxs/interfaces/generated/ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 diff --git a/MANIFEST.in b/MANIFEST.in index 7147a93d..b438112e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,3 @@ include README.md -include reflectivity_ui/* -recursive-include reflectivity_ui/icons *.png *.svg *.ico +include quicknxs/* +recursive-include quicknxs/icons *.png *.svg *.ico diff --git a/README.md b/README.md index 5512e74c..d01c1133 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -![Build Status](https://github.com/neutrons/reflectivity_ui/actions/workflows/actions.yml/badge.svg) +![Build Status](https://github.com/neutrons/quicknxs/actions/workflows/actions.yml/badge.svg) [![Documentation Status](https://readthedocs.org/projects/reflectivity-ui/badge/?version=latest)](https://reflectivity-ui.readthedocs.io/en/latest/?badge=latest) -[![codecov](https://codecov.io/gh/neutrons/reflectivity_ui/branch/master/graph/badge.svg)](https://codecov.io/gh/neutrons/reflectivity_ui) +[![codecov](https://codecov.io/gh/neutrons/quicknxs/branch/master/graph/badge.svg)](https://codecov.io/gh/neutrons/quicknxs) @@ -40,7 +40,7 @@ python -m build --no-isolation --wheel now you can install QuickNXS via the generated wheel on other system ```bash -python3 -m pip install reflectivity_ui*.whl +python3 -m pip install quicknxs*.whl ``` ## Run diff --git a/bin/RefRedM b/bin/RefRedM index f60c6816..f1d42bd6 100755 --- a/bin/RefRedM +++ b/bin/RefRedM @@ -34,14 +34,14 @@ sys.excepthook = no_abort_excepthook # Avoid clash with user-installed packages for item in sys.path: - if ".local" in item and "reflectivity_ui" not in item: + if ".local" in item and "quicknxs" not in item: sys.path.remove(item) for item in sys.modules: m = sys.modules.setdefault(item, types.ModuleType(item)) if m is not None: mp = m.__dict__.setdefault("__path__", []) for loc in mp: - if ".local" in loc and "reflectivity_ui" not in loc: + if ".local" in loc and "quicknxs" not in loc: logging.warning("Removing local reference to %s" % loc) mp.remove(loc) @@ -51,15 +51,15 @@ import matplotlib matplotlib.use("Qt5Agg") import mantid -import reflectivity_ui +import quicknxs print("##################################################") -print("# QuickNXS %s " % reflectivity_ui.__version__) +print("# QuickNXS %s " % quicknxs.__version__) print("# with Mantid: %s " % mantid.__version__) print("##################################################") from PyQt5.QtWidgets import QApplication -from reflectivity_ui.interfaces.main_window import MainWindow +from quicknxs.interfaces.main_window import MainWindow def main(): diff --git a/bin/quicknxs2 b/bin/quicknxs2 index ced6dd99..8d75b48e 100755 --- a/bin/quicknxs2 +++ b/bin/quicknxs2 @@ -38,15 +38,15 @@ import matplotlib matplotlib.use("Qt5Agg") import mantid -import reflectivity_ui +import quicknxs print("##################################################") -print("# QuickNXS %s " % reflectivity_ui.__version__) +print("# QuickNXS %s " % quicknxs.__version__) print("# with Mantid: %s " % mantid.__version__) print("##################################################") from PyQt5.QtWidgets import QApplication -from reflectivity_ui.interfaces.main_window import MainWindow +from quicknxs.interfaces.main_window import MainWindow def main(): diff --git a/build_tools/pylint.rc b/build_tools/pylint.rc deleted file mode 100644 index f6e9ccc5..00000000 --- a/build_tools/pylint.rc +++ /dev/null @@ -1,559 +0,0 @@ -[MASTER] - -# A comma-separated list of package or module names from where C extensions may -# be loaded. Extensions are loading into the active Python interpreter and may -# run arbitrary code -extension-pkg-whitelist=PyQt5, mantid - -# Add files or directories to the blacklist. They should be base names, not -# paths. -ignore=CVS - -# Add files or directories matching the regex patterns to the blacklist. The -# regex matches against base names, not paths. -ignore-patterns= - -# Python code to execute, usually for sys.path manipulation such as -# pygtk.require(). -#init-hook= - -# Use multiple processes to speed up Pylint. -jobs=1 - -# List of plugins (as comma separated values of python modules names) to load, -# usually to register additional checkers. -load-plugins= - -# Pickle collected data for later comparisons. -persistent=yes - -# Specify a configuration file. -#rcfile= - -# When enabled, pylint would attempt to guess common misconfiguration and emit -# user-friendly hints instead of false-positive error messages -suggestion-mode=yes - -# Allow loading of arbitrary C extensions. Extensions are imported into the -# active Python interpreter and may run arbitrary code. -unsafe-load-any-extension=no - - -[MESSAGES CONTROL] - -# Only show warnings with the listed confidence levels. Leave empty to show -# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED -confidence= - -# Disable the message, report, category or checker with the given id(s). You -# can either give multiple identifiers separated by comma (,) or put this -# option multiple times (only on the command line, not in the configuration -# file where it should appear only once).You can also use "--disable=all" to -# disable everything first and then reenable specific checks. For example, if -# you want to run only the similarities checker, you can use "--disable=all -# --enable=similarities". If you want to run only the classes checker, but have -# no Warning level messages displayed, use"--disable=all --enable=classes -# --disable=W" -disable=print-statement, - parameter-unpacking, - unpacking-in-except, - old-raise-syntax, - backtick, - long-suffix, - old-ne-operator, - old-octal-literal, - import-star-module-level, - non-ascii-bytes-literal, - raw-checker-failed, - bad-inline-option, - locally-disabled, - locally-enabled, - file-ignored, - suppressed-message, - useless-suppression, - deprecated-pragma, - apply-builtin, - basestring-builtin, - buffer-builtin, - cmp-builtin, - coerce-builtin, - execfile-builtin, - file-builtin, - long-builtin, - raw_input-builtin, - reduce-builtin, - standarderror-builtin, - unicode-builtin, - xrange-builtin, - coerce-method, - delslice-method, - getslice-method, - setslice-method, - no-absolute-import, - old-division, - dict-iter-method, - dict-view-method, - next-method-called, - metaclass-assignment, - indexing-exception, - raising-string, - reload-builtin, - oct-method, - hex-method, - nonzero-method, - cmp-method, - input-builtin, - round-builtin, - intern-builtin, - unichr-builtin, - map-builtin-not-iterating, - zip-builtin-not-iterating, - range-builtin-not-iterating, - filter-builtin-not-iterating, - using-cmp-argument, - eq-without-hash, - div-method, - idiv-method, - rdiv-method, - exception-message-attribute, - invalid-str-codec, - sys-max-int, - bad-python3-import, - deprecated-string-function, - deprecated-str-translate-call, - deprecated-itertools-function, - deprecated-types-field, - next-method-defined, - dict-items-not-iterating, - dict-keys-not-iterating, - dict-values-not-iterating - -# Enable the message, report, category or checker with the given id(s). You can -# either give multiple identifier separated by comma (,) or put this option -# multiple time (only on the command line, not in the configuration file where -# it should appear only once). See also the "--disable" option for examples. -enable=c-extension-no-member - - -[REPORTS] - -# Python expression which should return a note less than 10 (10 is the highest -# note). You have access to the variables errors warning, statement which -# respectively contain the number of errors / warnings messages and the total -# number of statements analyzed. This is used by the global evaluation report -# (RP0004). -evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) - -# Template used to display messages. This is a python new-style format string -# used to format the message information. See doc for all details -#msg-template= - -# Set the output format. Available formats are text, parseable, colorized, json -# and msvs (visual studio).You can also give a reporter class, eg -# mypackage.mymodule.MyReporterClass. -output-format=text - -# Tells whether to display a full report or only the messages -reports=no - -# Activate the evaluation score. -score=yes - - -[REFACTORING] - -# Maximum number of nested blocks for function / method body -max-nested-blocks=5 - -# Complete name of functions that never returns. When checking for -# inconsistent-return-statements if a never returning function is called then -# it will be considered as an explicit return statement and no message will be -# printed. -never-returning-functions=optparse.Values,sys.exit - - -[FORMAT] - -# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. -expected-line-ending-format= - -# Regexp for a line that is allowed to be longer than the limit. -ignore-long-lines=^\s*(# )??$ - -# Number of spaces of indent required inside a hanging or continued line. -indent-after-paren=4 - -# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 -# tab). -indent-string=' ' - -# Maximum number of characters on a single line. -max-line-length=130 - -# Maximum number of lines in a module -max-module-lines=1000 - -# List of optional constructs for which whitespace checking is disabled. `dict- -# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. -# `trailing-comma` allows a space between comma and closing bracket: (a, ). -# `empty-line` allows space-only lines. -no-space-check=trailing-comma, - dict-separator - -# Allow the body of a class to be on the same line as the declaration if body -# contains single statement. -single-line-class-stmt=no - -# Allow the body of an if to be on the same line as the test if there is no -# else. -single-line-if-stmt=no - - -[MISCELLANEOUS] - -# List of note tags to take in consideration, separated by a comma. -notes=FIXME, - XXX, - TODO - - -[BASIC] - -# Naming style matching correct argument names -argument-naming-style=snake_case - -# Regular expression matching correct argument names. Overrides argument- -# naming-style -#argument-rgx= - -# Naming style matching correct attribute names -attr-naming-style=snake_case - -# Regular expression matching correct attribute names. Overrides attr-naming- -# style -#attr-rgx= - -# Bad variable names which should always be refused, separated by a comma -bad-names=foo, - bar, - baz, - toto, - tutu, - tata - -# Naming style matching correct class attribute names -class-attribute-naming-style=any - -# Regular expression matching correct class attribute names. Overrides class- -# attribute-naming-style -#class-attribute-rgx= - -# Naming style matching correct class names -class-naming-style=PascalCase - -# Regular expression matching correct class names. Overrides class-naming-style -#class-rgx= - -# Naming style matching correct constant names -const-naming-style=UPPER_CASE - -# Regular expression matching correct constant names. Overrides const-naming- -# style -#const-rgx= - -# Minimum line length for functions/classes that require docstrings, shorter -# ones are exempt. -docstring-min-length=-1 - -# Naming style matching correct function names -function-naming-style=snake_case - -# Regular expression matching correct function names. Overrides function- -# naming-style -#function-rgx= - -# Good variable names which should always be accepted, separated by a comma -good-names=i, - j, - k, - ex, - Run, - _, - x, - y, - z, - q, - dq, - dx, - dy, - dz, - r, - dr, - S, - dS, - xs, - Qx, - Qy, - Qz, - ws - -# Include a hint for the correct naming format with invalid-name -include-naming-hint=no - -# Naming style matching correct inline iteration names -inlinevar-naming-style=any - -# Regular expression matching correct inline iteration names. Overrides -# inlinevar-naming-style -#inlinevar-rgx= - -# Naming style matching correct method names -method-naming-style=snake_case - -# Regular expression matching correct method names. Overrides method-naming- -# style -#method-rgx= - -# Naming style matching correct module names -module-naming-style=snake_case - -# Regular expression matching correct module names. Overrides module-naming- -# style -#module-rgx= - -# Colon-delimited sets of names that determine each other's naming style when -# the name regexes allow several styles. -name-group= - -# Regular expression which should only match function or class names that do -# not require a docstring. -no-docstring-rgx=^_ - -# List of decorators that produce properties, such as abc.abstractproperty. Add -# to this list to register other decorators that produce valid properties. -property-classes=abc.abstractproperty - -# Naming style matching correct variable names -variable-naming-style=snake_case - -# Regular expression matching correct variable names. Overrides variable- -# naming-style -#variable-rgx= - - -[TYPECHECK] - -# List of decorators that produce context managers, such as -# contextlib.contextmanager. Add to this list to register other decorators that -# produce valid context managers. -contextmanager-decorators=contextlib.contextmanager - -# List of members which are set dynamically and missed by pylint inference -# system, and so shouldn't trigger E1101 when accessed. Python regular -# expressions are accepted. -generated-members= - -# Tells whether missing members accessed in mixin class should be ignored. A -# mixin class is detected if its name ends with "mixin" (case insensitive). -ignore-mixin-members=yes - -# This flag controls whether pylint should warn about no-member and similar -# checks whenever an opaque object is returned when inferring. The inference -# can return multiple potential results while evaluating a Python object, but -# some branches might not be evaluated, which results in partial inference. In -# that case, it might be useful to still emit no-member and other checks for -# the rest of the inferred objects. -ignore-on-opaque-inference=yes - -# List of class names for which member attributes should not be checked (useful -# for classes with dynamically set attributes). This supports the use of -# qualified names. -ignored-classes=optparse.Values,thread._local,_thread._local - -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis. It -# supports qualified module names, as well as Unix pattern matching. -ignored-modules= - -# Show a hint with possible names when a member name was not found. The aspect -# of finding the hint is based on edit distance. -missing-member-hint=yes - -# The minimum edit distance a name should have in order to be considered a -# similar match for a missing member name. -missing-member-hint-distance=1 - -# The total number of similar names that should be taken in consideration when -# showing a hint for a missing member. -missing-member-max-choices=1 - - -[SPELLING] - -# Limits count of emitted suggestions for spelling mistakes -max-spelling-suggestions=4 - -# Spelling dictionary name. Available dictionaries: none. To make it working -# install python-enchant package. -spelling-dict= - -# List of comma separated words that should not be checked. -spelling-ignore-words= - -# A path to a file that contains private dictionary; one word per line. -spelling-private-dict-file= - -# Tells whether to store unknown words to indicated private dictionary in -# --spelling-private-dict-file option instead of raising a message. -spelling-store-unknown-words=no - - -[LOGGING] - -# Logging modules to check that the string format arguments are in logging -# function parameter format -logging-modules=logging - - -[VARIABLES] - -# List of additional names supposed to be defined in builtins. Remember that -# you should avoid to define new builtins when possible. -additional-builtins= - -# Tells whether unused global variables should be treated as a violation. -allow-global-unused-variables=yes - -# List of strings which can identify a callback function by name. A callback -# name must start or end with one of those strings. -callbacks=cb_, - _cb - -# A regular expression matching the name of dummy variables (i.e. expectedly -# not used). -dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ - -# Argument names that match this expression will be ignored. Default to name -# with leading underscore -ignored-argument-names=_.*|^ignored_|^unused_ - -# Tells whether we should check for unused import in __init__ files. -init-import=no - -# List of qualified module names which can have objects that can redefine -# builtins. -redefining-builtins-modules=six.moves,past.builtins,future.builtins - - -[SIMILARITIES] - -# Ignore comments when computing similarities. -ignore-comments=yes - -# Ignore docstrings when computing similarities. -ignore-docstrings=yes - -# Ignore imports when computing similarities. -ignore-imports=no - -# Minimum lines number of a similarity. -min-similarity-lines=4 - - -[CLASSES] - -# List of method names used to declare (i.e. assign) instance attributes. -defining-attr-methods=__init__, - __new__, - setUp - -# List of member names, which should be excluded from the protected access -# warning. -exclude-protected=_asdict, - _fields, - _replace, - _source, - _make - -# List of valid names for the first argument in a class method. -valid-classmethod-first-arg=cls - -# List of valid names for the first argument in a metaclass class method. -valid-metaclass-classmethod-first-arg=mcs - - -[IMPORTS] - -# Allow wildcard imports from modules that define __all__. -allow-wildcard-with-all=no - -# Analyse import fallback blocks. This can be used to support both Python 2 and -# 3 compatible code, which means that the block might have code that exists -# only in one or another interpreter, leading to false positives when analysed. -analyse-fallback-blocks=no - -# Deprecated modules which should not be used, separated by a comma -deprecated-modules=regsub, - TERMIOS, - Bastion, - rexec - -# Create a graph of external dependencies in the given file (report RP0402 must -# not be disabled) -ext-import-graph= - -# Create a graph of every (i.e. internal and external) dependencies in the -# given file (report RP0402 must not be disabled) -import-graph= - -# Create a graph of internal dependencies in the given file (report RP0402 must -# not be disabled) -int-import-graph= - -# Force import order to recognize a module as part of the standard -# compatibility libraries. -known-standard-library= - -# Force import order to recognize a module as part of a third party library. -known-third-party=enchant - - -[DESIGN] - -# Maximum number of arguments for function / method -max-args=6 - -# Maximum number of attributes for a class (see R0902). -max-attributes=8 - -# Maximum number of boolean expressions in a if statement -max-bool-expr=5 - -# Maximum number of branch for function / method body -max-branches=12 - -# Maximum number of locals for function / method body -max-locals=20 # Up from 15 - -# Maximum number of parents for a class (see R0901). -max-parents=7 - -# Maximum number of public methods for a class (see R0904). -max-public-methods=20 - -# Maximum number of return / yield for function / method body -max-returns=6 - -# Maximum number of statements in function / method body -max-statements=50 - -# Minimum number of public methods for a class (see R0903). -min-public-methods=2 - - -[EXCEPTIONS] - -# Exceptions that will emit a warning when being caught. Defaults to -# "Exception" -overgeneral-exceptions=Exception diff --git a/build_tools/travis_ci_build.sh b/build_tools/travis_ci_build.sh deleted file mode 100644 index fb70cd6c..00000000 --- a/build_tools/travis_ci_build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -python setup.py install -coverage run test/data_handling_test.py -pylint --rcfile build_tools/pylint.rc -f parseable reflectivity_ui/interfaces/data_handling reflectivity_ui/interfaces/event_handlers diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index 869d813c..48fc22dc 100644 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -9,7 +9,7 @@ {% set version_number = environ.get('GIT_DESCRIBE_NUMBER', '0') | string %} package: - name: "reflectivity_ui" + name: "quicknxs" version: {{ version }} source: @@ -41,7 +41,7 @@ requirements: test: imports: - - reflectivity_ui + - quicknxs about: home: {{ url }} diff --git a/docs/api/modules.rst b/docs/api/modules.rst index e84b426e..94685829 100644 --- a/docs/api/modules.rst +++ b/docs/api/modules.rst @@ -6,4 +6,4 @@ API .. toctree:: :maxdepth: 4 - reflectivity_ui + quicknxs diff --git a/docs/api/reflectivity_ui.config.rst b/docs/api/quicknxs.config.rst similarity index 55% rename from docs/api/reflectivity_ui.config.rst rename to docs/api/quicknxs.config.rst index 196e25fb..0adc1287 100644 --- a/docs/api/reflectivity_ui.config.rst +++ b/docs/api/quicknxs.config.rst @@ -1,7 +1,7 @@ -reflectivity\_ui.config package +quicknxs.config package =============================== -.. automodule:: reflectivity_ui.config +.. automodule:: quicknxs.config :members: :undoc-members: :show-inheritance: @@ -10,18 +10,18 @@ reflectivity\_ui.config package Submodules ---------- -reflectivity\_ui.config.gui module +quicknxs.config.gui module ---------------------------------- -.. automodule:: reflectivity_ui.config.gui +.. automodule:: quicknxs.config.gui :members: :undoc-members: :show-inheritance: -reflectivity\_ui.config.plotting module +quicknxs.config.plotting module --------------------------------------- -.. automodule:: reflectivity_ui.config.plotting +.. automodule:: quicknxs.config.plotting :members: :undoc-members: :show-inheritance: diff --git a/docs/api/quicknxs.interfaces.data_handling.rst b/docs/api/quicknxs.interfaces.data_handling.rst new file mode 100644 index 00000000..1e5bb4c2 --- /dev/null +++ b/docs/api/quicknxs.interfaces.data_handling.rst @@ -0,0 +1,91 @@ +quicknxs.interfaces.data\_handling package +================================================== + +.. automodule:: quicknxs.interfaces.data_handling + :members: + :undoc-members: + :show-inheritance: + + +Submodules +---------- + +quicknxs.interfaces.data\_handling.data\_info module +------------------------------------------------------------ + +.. automodule:: quicknxs.interfaces.data_handling.data_info + :members: + :undoc-members: + :show-inheritance: + +quicknxs.interfaces.data\_handling.data\_manipulation module +-------------------------------------------------------------------- + +.. automodule:: quicknxs.interfaces.data_handling.data_manipulation + :members: + :undoc-members: + :show-inheritance: + +quicknxs.interfaces.data\_handling.data\_set module +----------------------------------------------------------- + +.. automodule:: quicknxs.interfaces.data_handling.data_set + :members: + :undoc-members: + :show-inheritance: + +quicknxs.interfaces.data\_handling.filepath module +---------------------------------------------------------- + +.. automodule:: quicknxs.interfaces.data_handling.filepath + :members: + :undoc-members: + :show-inheritance: + +quicknxs.interfaces.data\_handling.gisans module +-------------------------------------------------------- + +.. automodule:: quicknxs.interfaces.data_handling.gisans + :members: + :undoc-members: + :show-inheritance: + +quicknxs.interfaces.data\_handling.instrument module +------------------------------------------------------------ + +.. automodule:: quicknxs.interfaces.data_handling.instrument + :members: + :undoc-members: + :show-inheritance: + +quicknxs.interfaces.data\_handling.off\_specular module +--------------------------------------------------------------- + +.. automodule:: quicknxs.interfaces.data_handling.off_specular + :members: + :undoc-members: + :show-inheritance: + +quicknxs.interfaces.data\_handling.peak\_finding module +--------------------------------------------------------------- + +.. automodule:: quicknxs.interfaces.data_handling.peak_finding + :members: + :undoc-members: + :show-inheritance: + +quicknxs.interfaces.data\_handling.processing\_workflow module +---------------------------------------------------------------------- + +.. automodule:: quicknxs.interfaces.data_handling.processing_workflow + :members: + :undoc-members: + :show-inheritance: + +quicknxs.interfaces.data\_handling.quicknxs\_io module +-------------------------------------------------------------- + +.. automodule:: quicknxs.interfaces.data_handling.quicknxs_io + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/quicknxs.interfaces.event_handlers.rst b/docs/api/quicknxs.interfaces.event_handlers.rst new file mode 100644 index 00000000..455193f1 --- /dev/null +++ b/docs/api/quicknxs.interfaces.event_handlers.rst @@ -0,0 +1,51 @@ +quicknxs.interfaces.event\_handlers package +=================================================== + +.. automodule:: quicknxs.interfaces.event_handlers + :members: + :undoc-members: + :show-inheritance: + + +Submodules +---------- + +quicknxs.interfaces.event\_handlers.configuration\_handler module +------------------------------------------------------------------------- + +.. automodule:: quicknxs.interfaces.event_handlers.configuration_handler + :members: + :undoc-members: + :show-inheritance: + +quicknxs.interfaces.event\_handlers.main\_handler module +---------------------------------------------------------------- + +.. automodule:: quicknxs.interfaces.event_handlers.main_handler + :members: + :undoc-members: + :show-inheritance: + +quicknxs.interfaces.event\_handlers.plot\_handler module +---------------------------------------------------------------- + +.. automodule:: quicknxs.interfaces.event_handlers.plot_handler + :members: + :undoc-members: + :show-inheritance: + +quicknxs.interfaces.event\_handlers.progress\_reporter module +--------------------------------------------------------------------- + +.. automodule:: quicknxs.interfaces.event_handlers.progress_reporter + :members: + :undoc-members: + :show-inheritance: + +quicknxs.interfaces.event\_handlers.widgets module +---------------------------------------------------------- + +.. automodule:: quicknxs.interfaces.event_handlers.widgets + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/reflectivity_ui.interfaces.rst b/docs/api/quicknxs.interfaces.rst similarity index 50% rename from docs/api/reflectivity_ui.interfaces.rst rename to docs/api/quicknxs.interfaces.rst index 977df4ad..c2bed444 100644 --- a/docs/api/reflectivity_ui.interfaces.rst +++ b/docs/api/quicknxs.interfaces.rst @@ -1,7 +1,7 @@ -reflectivity\_ui.interfaces package +quicknxs.interfaces package =================================== -.. automodule:: reflectivity_ui.interfaces +.. automodule:: quicknxs.interfaces :members: :undoc-members: :show-inheritance: @@ -13,65 +13,65 @@ Subpackages .. toctree:: :maxdepth: 4 - reflectivity_ui.interfaces.data_handling - reflectivity_ui.interfaces.event_handlers + quicknxs.interfaces.data_handling + quicknxs.interfaces.event_handlers Submodules ---------- -reflectivity\_ui.interfaces.configuration. module +quicknxs.interfaces.configuration. module ------------------------------------------------- -.. automodule:: reflectivity_ui.interfaces.configuration +.. automodule:: quicknxs.interfaces.configuration :members: :undoc-members: :show-inheritance: -reflectivity\_ui.interfaces.data\_manager module +quicknxs.interfaces.data\_manager module ------------------------------------------------ -.. automodule:: reflectivity_ui.interfaces.data_manager +.. automodule:: quicknxs.interfaces.data_manager :members: :undoc-members: :show-inheritance: -reflectivity\_ui.interfaces.main\_window module +quicknxs.interfaces.main\_window module ----------------------------------------------- -.. automodule:: reflectivity_ui.interfaces.main_window +.. automodule:: quicknxs.interfaces.main_window :members: :undoc-members: :show-inheritance: -reflectivity\_ui.interfaces.plotting module +quicknxs.interfaces.plotting module ------------------------------------------- -.. automodule:: reflectivity_ui.interfaces.plotting +.. automodule:: quicknxs.interfaces.plotting :members: :undoc-members: :show-inheritance: -reflectivity\_ui.interfaces.reduction\_dialog module +quicknxs.interfaces.reduction\_dialog module ---------------------------------------------------- -.. automodule:: reflectivity_ui.interfaces.reduction_dialog +.. automodule:: quicknxs.interfaces.reduction_dialog :members: :undoc-members: :show-inheritance: -reflectivity\_ui.interfaces.result\_viewer module +quicknxs.interfaces.result\_viewer module ------------------------------------------------- -.. automodule:: reflectivity_ui.interfaces.result_viewer +.. automodule:: quicknxs.interfaces.result_viewer :members: :undoc-members: :show-inheritance: -reflectivity\_ui.interfaces.smooth\_dialog module +quicknxs.interfaces.smooth\_dialog module ------------------------------------------------- -.. automodule:: reflectivity_ui.interfaces.smooth_dialog +.. automodule:: quicknxs.interfaces.smooth_dialog :members: :undoc-members: :show-inheritance: diff --git a/docs/api/reflectivity_ui.rst b/docs/api/quicknxs.rst similarity index 50% rename from docs/api/reflectivity_ui.rst rename to docs/api/quicknxs.rst index 30f2a892..59d2e701 100644 --- a/docs/api/reflectivity_ui.rst +++ b/docs/api/quicknxs.rst @@ -1,7 +1,7 @@ -reflectivity\_ui package +quicknxs package ======================== -.. automodule:: reflectivity_ui +.. automodule:: quicknxs :members: :undoc-members: :show-inheritance: @@ -12,6 +12,6 @@ Subpackages .. toctree:: :maxdepth: 4 - reflectivity_ui.config - reflectivity_ui.interfaces - reflectivity_ui.ui + quicknxs.config + quicknxs.interfaces + quicknxs.ui diff --git a/docs/api/reflectivity_ui.ui.rst b/docs/api/quicknxs.ui.rst similarity index 57% rename from docs/api/reflectivity_ui.ui.rst rename to docs/api/quicknxs.ui.rst index 6b79f296..2a4e8987 100644 --- a/docs/api/reflectivity_ui.ui.rst +++ b/docs/api/quicknxs.ui.rst @@ -1,7 +1,7 @@ -reflectivity\_ui.ui package +quicknxs.ui package =========================== -.. automodule:: reflectivity_ui.ui +.. automodule:: quicknxs.ui :members: :undoc-members: :show-inheritance: @@ -10,10 +10,10 @@ reflectivity\_ui.ui package Submodules ---------- -reflectivity\_ui.ui.compare\_plots module +quicknxs.ui.compare\_plots module ------------------------------------------ -.. automodule:: reflectivity_ui.ui.compare_plots +.. automodule:: quicknxs.ui.compare_plots :members: :undoc-members: :show-inheritance: diff --git a/docs/api/reflectivity_ui.interfaces.data_handling.rst b/docs/api/reflectivity_ui.interfaces.data_handling.rst deleted file mode 100644 index 78ca7673..00000000 --- a/docs/api/reflectivity_ui.interfaces.data_handling.rst +++ /dev/null @@ -1,91 +0,0 @@ -reflectivity\_ui.interfaces.data\_handling package -================================================== - -.. automodule:: reflectivity_ui.interfaces.data_handling - :members: - :undoc-members: - :show-inheritance: - - -Submodules ----------- - -reflectivity\_ui.interfaces.data\_handling.data\_info module ------------------------------------------------------------- - -.. automodule:: reflectivity_ui.interfaces.data_handling.data_info - :members: - :undoc-members: - :show-inheritance: - -reflectivity\_ui.interfaces.data\_handling.data\_manipulation module --------------------------------------------------------------------- - -.. automodule:: reflectivity_ui.interfaces.data_handling.data_manipulation - :members: - :undoc-members: - :show-inheritance: - -reflectivity\_ui.interfaces.data\_handling.data\_set module ------------------------------------------------------------ - -.. automodule:: reflectivity_ui.interfaces.data_handling.data_set - :members: - :undoc-members: - :show-inheritance: - -reflectivity\_ui.interfaces.data\_handling.filepath module ----------------------------------------------------------- - -.. automodule:: reflectivity_ui.interfaces.data_handling.filepath - :members: - :undoc-members: - :show-inheritance: - -reflectivity\_ui.interfaces.data\_handling.gisans module --------------------------------------------------------- - -.. automodule:: reflectivity_ui.interfaces.data_handling.gisans - :members: - :undoc-members: - :show-inheritance: - -reflectivity\_ui.interfaces.data\_handling.instrument module ------------------------------------------------------------- - -.. automodule:: reflectivity_ui.interfaces.data_handling.instrument - :members: - :undoc-members: - :show-inheritance: - -reflectivity\_ui.interfaces.data\_handling.off\_specular module ---------------------------------------------------------------- - -.. automodule:: reflectivity_ui.interfaces.data_handling.off_specular - :members: - :undoc-members: - :show-inheritance: - -reflectivity\_ui.interfaces.data\_handling.peak\_finding module ---------------------------------------------------------------- - -.. automodule:: reflectivity_ui.interfaces.data_handling.peak_finding - :members: - :undoc-members: - :show-inheritance: - -reflectivity\_ui.interfaces.data\_handling.processing\_workflow module ----------------------------------------------------------------------- - -.. automodule:: reflectivity_ui.interfaces.data_handling.processing_workflow - :members: - :undoc-members: - :show-inheritance: - -reflectivity\_ui.interfaces.data\_handling.quicknxs\_io module --------------------------------------------------------------- - -.. automodule:: reflectivity_ui.interfaces.data_handling.quicknxs_io - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/api/reflectivity_ui.interfaces.event_handlers.rst b/docs/api/reflectivity_ui.interfaces.event_handlers.rst deleted file mode 100644 index 14f95185..00000000 --- a/docs/api/reflectivity_ui.interfaces.event_handlers.rst +++ /dev/null @@ -1,51 +0,0 @@ -reflectivity\_ui.interfaces.event\_handlers package -=================================================== - -.. automodule:: reflectivity_ui.interfaces.event_handlers - :members: - :undoc-members: - :show-inheritance: - - -Submodules ----------- - -reflectivity\_ui.interfaces.event\_handlers.configuration\_handler module -------------------------------------------------------------------------- - -.. automodule:: reflectivity_ui.interfaces.event_handlers.configuration_handler - :members: - :undoc-members: - :show-inheritance: - -reflectivity\_ui.interfaces.event\_handlers.main\_handler module ----------------------------------------------------------------- - -.. automodule:: reflectivity_ui.interfaces.event_handlers.main_handler - :members: - :undoc-members: - :show-inheritance: - -reflectivity\_ui.interfaces.event\_handlers.plot\_handler module ----------------------------------------------------------------- - -.. automodule:: reflectivity_ui.interfaces.event_handlers.plot_handler - :members: - :undoc-members: - :show-inheritance: - -reflectivity\_ui.interfaces.event\_handlers.progress\_reporter module ---------------------------------------------------------------------- - -.. automodule:: reflectivity_ui.interfaces.event_handlers.progress_reporter - :members: - :undoc-members: - :show-inheritance: - -reflectivity\_ui.interfaces.event\_handlers.widgets module ----------------------------------------------------------- - -.. automodule:: reflectivity_ui.interfaces.event_handlers.widgets - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/conf.py b/docs/conf.py index 1a69b761..67bd66ec 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -7,7 +7,7 @@ sys.path.insert(0, os.path.abspath("../")) -from reflectivity_ui import __version__ as release +from quicknxs import __version__ as release # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information diff --git a/docs/developer/environment.rst b/docs/developer/environment.rst index 56891b6d..aae5b3f0 100644 --- a/docs/developer/environment.rst +++ b/docs/developer/environment.rst @@ -37,7 +37,7 @@ Test Data --------- The test data will be stored in a second git repository -`reflectivity_ui-data `_ +`quicknxs-data `_ which uses git-lfs. To use it, first install git-lfs, then setup the git-submodule diff --git a/docs/developer/integration_test.rst b/docs/developer/integration_test.rst index 03e0dda3..a047cd32 100644 --- a/docs/developer/integration_test.rst +++ b/docs/developer/integration_test.rst @@ -7,7 +7,7 @@ The Data Repository =================== Integration tests will typically require data from the **data repository** -located in `reflectivity_ui/tests/data/reflectivity_ui-data/` as a +located in `quicknxs/tests/data/quicknxs-data/` as a `git submodule `_. Git Submodule @@ -20,10 +20,10 @@ Git Submodule **typical commands:** -Here, "submodule" refers to repo `reflectivity_ui-data` and "parent" refers to repo `reflectivity_ui` +Here, "submodule" refers to repo `quicknxs-data` and "parent" refers to repo `quicknxs` - checkout the submodule after cloning the parent with command `git submodule init` -- find the refspec stored in the parent with command `git ls-tree $(git branch --show-current) tests/data/reflectivity_ui-data` +- find the refspec stored in the parent with command `git ls-tree $(git branch --show-current) tests/data/quicknxs-data` - synchronize the submodule to the refspec stored in the parent with command `git submodule update` - after making commits in the sumodule, synchronize the refspec stored in the parent with commands `git add...` and `git commit...` @@ -35,7 +35,7 @@ Pytest fixtures in `conftest.py` providing directories frequently accessed: +--------------+----------------------------------------------------------------------------+ | Fixture | Value (as a `pathlib.Path` object) | +==============+============================================================================+ -| DATA_DIR | reflectivity_ui/tests/data/reflectivity_ui-data | +| DATA_DIR | quicknxs/tests/data/quicknxs-data | +--------------+----------------------------------------------------------------------------+ diff --git a/docs/developer/overview.rst b/docs/developer/overview.rst index a177a446..6031b68c 100644 --- a/docs/developer/overview.rst +++ b/docs/developer/overview.rst @@ -9,7 +9,7 @@ Overview Developer Account ----------------- -All the development work is done via GitHub, and the developers working on ``reflectivity_ui`` must have a valid GitHub account with 2-step authentication enabled. +All the development work is done via GitHub, and the developers working on ``quicknxs`` must have a valid GitHub account with 2-step authentication enabled. For developers who are part of SAE@ORNL, please contact a senior developer to add you to the project. @@ -62,4 +62,4 @@ Once the final approval from CIS team is given, this ``qa`` branch will be merge At the beginning of every month, a auto pipeline will tag the current ``main`` if there are new features or bug fixes, along with publishing the new version to the production server for general users to use. By default, the ``next`` branch is published to a conda channel called ``neutrons`` whenever a feature branch is merged into ``next``. -Similarly, the tagging of ``main`` will trigger the pipeline to publish the stable version of ``reflectivity_ui`` to both ``conda-forge`` as well as ``PyPI``. +Similarly, the tagging of ``main`` will trigger the pipeline to publish the stable version of ``quicknxs`` to both ``conda-forge`` as well as ``PyPI``. diff --git a/docs/developer/release.rst b/docs/developer/release.rst index 75205e52..1b1c9bf4 100644 --- a/docs/developer/release.rst +++ b/docs/developer/release.rst @@ -17,7 +17,7 @@ Candidate and Production Releases Conda Package ------------- -Candidate and Production releases ``reflectivity_ui`` are automatically released to the project channel +Candidate and Production releases ``quicknxs`` are automatically released to the project channel `neutrons`_ whenever a new tag is pushed to the repository. To manually build a conda package (for testing puruposes only), diff --git a/docs/releasenotes/index.rst b/docs/releasenotes/index.rst index ca638931..2ebfc27f 100644 --- a/docs/releasenotes/index.rst +++ b/docs/releasenotes/index.rst @@ -12,6 +12,7 @@ Notes for major and minor releases. Notes for Patch releases are deferred. **Of interest to the User**: +- PR #119: Rename the repository to "quicknxs" - PR #115: Skip reflectivity calculation for direct beams - PR #118: Skip plotting "Active" line when direct beam selected - PR #112: Make the minimum number of events cut-off configurable in ~/.config/.refredm.conf diff --git a/docs/user/dead_time_correction.rst b/docs/user/dead_time_correction.rst index 00af2a95..4105d7a0 100644 --- a/docs/user/dead_time_correction.rst +++ b/docs/user/dead_time_correction.rst @@ -86,10 +86,10 @@ Example using ``SingleReadoutDeadTimeCorrection`` (requires :any:`test-data` fil import os import sys from pathlib import Path - from reflectivity_ui.interfaces.data_handling import DeadTimeCorrection - from reflectivity_ui.interfaces.data_handling.instrument import mantid_algorithm_exec + from quicknxs.interfaces.data_handling import DeadTimeCorrection + from quicknxs.interfaces.data_handling.instrument import mantid_algorithm_exec # Load events - path = Path().resolve().parent / "test" / "data" / "reflectivity_ui-data" / "REF_M_42112.nxs.h5" + path = Path().resolve().parent / "test" / "data" / "quicknxs-data" / "REF_M_42112.nxs.h5" path = path.as_posix() ws = api.LoadEventNexus(Filename=path, OutputWorkspace="raw_events") # Load error events diff --git a/pyproject.toml b/pyproject.toml index f60fcd5e..8d69d9b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ dirty = "{version}+d{build_date:%Y%m%d}" distance-dirty = "{next_version}.dev{distance}+d{build_date:%Y%m%d%H%M}" [tool.versioningit.write] -file = "reflectivity_ui/_version.py" +file = "quicknxs/_version.py" [tool.pytest.ini_options] testpaths = ["test/"] diff --git a/reflectivity_ui/__init__.py b/quicknxs/__init__.py similarity index 100% rename from reflectivity_ui/__init__.py rename to quicknxs/__init__.py diff --git a/reflectivity_ui/config/__init__.py b/quicknxs/config/__init__.py similarity index 100% rename from reflectivity_ui/config/__init__.py rename to quicknxs/config/__init__.py diff --git a/reflectivity_ui/config/gui.py b/quicknxs/config/gui.py similarity index 100% rename from reflectivity_ui/config/gui.py rename to quicknxs/config/gui.py diff --git a/reflectivity_ui/config/plotting.py b/quicknxs/config/plotting.py similarity index 100% rename from reflectivity_ui/config/plotting.py rename to quicknxs/config/plotting.py diff --git a/reflectivity_ui/config/settings.json b/quicknxs/config/settings.json similarity index 100% rename from reflectivity_ui/config/settings.json rename to quicknxs/config/settings.json diff --git a/reflectivity_ui/icons/addRef.png b/quicknxs/icons/addRef.png similarity index 100% rename from reflectivity_ui/icons/addRef.png rename to quicknxs/icons/addRef.png diff --git a/reflectivity_ui/icons/addRef.svg b/quicknxs/icons/addRef.svg similarity index 100% rename from reflectivity_ui/icons/addRef.svg rename to quicknxs/icons/addRef.svg diff --git a/reflectivity_ui/icons/autoNorm.png b/quicknxs/icons/autoNorm.png similarity index 100% rename from reflectivity_ui/icons/autoNorm.png rename to quicknxs/icons/autoNorm.png diff --git a/reflectivity_ui/icons/autoNorm.svg b/quicknxs/icons/autoNorm.svg similarity index 100% rename from reflectivity_ui/icons/autoNorm.svg rename to quicknxs/icons/autoNorm.svg diff --git a/reflectivity_ui/icons/autoRef.png b/quicknxs/icons/autoRef.png similarity index 100% rename from reflectivity_ui/icons/autoRef.png rename to quicknxs/icons/autoRef.png diff --git a/reflectivity_ui/icons/autoRef.svg b/quicknxs/icons/autoRef.svg similarity index 100% rename from reflectivity_ui/icons/autoRef.svg rename to quicknxs/icons/autoRef.svg diff --git a/reflectivity_ui/icons/clearNorm.png b/quicknxs/icons/clearNorm.png similarity index 100% rename from reflectivity_ui/icons/clearNorm.png rename to quicknxs/icons/clearNorm.png diff --git a/reflectivity_ui/icons/clearNorm.svg b/quicknxs/icons/clearNorm.svg similarity index 100% rename from reflectivity_ui/icons/clearNorm.svg rename to quicknxs/icons/clearNorm.svg diff --git a/reflectivity_ui/icons/clearRef.png b/quicknxs/icons/clearRef.png similarity index 100% rename from reflectivity_ui/icons/clearRef.png rename to quicknxs/icons/clearRef.png diff --git a/reflectivity_ui/icons/clearRef.svg b/quicknxs/icons/clearRef.svg similarity index 100% rename from reflectivity_ui/icons/clearRef.svg rename to quicknxs/icons/clearRef.svg diff --git a/reflectivity_ui/icons/cutPoints.png b/quicknxs/icons/cutPoints.png similarity index 100% rename from reflectivity_ui/icons/cutPoints.png rename to quicknxs/icons/cutPoints.png diff --git a/reflectivity_ui/icons/cutPoints.svg b/quicknxs/icons/cutPoints.svg similarity index 100% rename from reflectivity_ui/icons/cutPoints.svg rename to quicknxs/icons/cutPoints.svg diff --git a/reflectivity_ui/icons/delNormalization.png b/quicknxs/icons/delNormalization.png similarity index 100% rename from reflectivity_ui/icons/delNormalization.png rename to quicknxs/icons/delNormalization.png diff --git a/reflectivity_ui/icons/delNormalization.svg b/quicknxs/icons/delNormalization.svg similarity index 98% rename from reflectivity_ui/icons/delNormalization.svg rename to quicknxs/icons/delNormalization.svg index 59c16a01..2d58fd74 100644 --- a/reflectivity_ui/icons/delNormalization.svg +++ b/quicknxs/icons/delNormalization.svg @@ -17,7 +17,7 @@ version="1.1" inkscape:version="0.91 r13725" sodipodi:docname="delNormalization.svg" - inkscape:export-filename="/Users/m2d/git/reflectivity_ui/icons/delNormalization.png" + inkscape:export-filename="/Users/m2d/git/quicknxs/icons/delNormalization.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> MPLWidget QWidget -
reflectivity_ui/ui/mplwidget.h
+
quicknxs/ui/mplwidget.h
1 diff --git a/reflectivity_ui/ui/ui_main_window-edit.ui b/quicknxs/ui/ui_main_window-edit.ui similarity index 99% rename from reflectivity_ui/ui/ui_main_window-edit.ui rename to quicknxs/ui/ui_main_window-edit.ui index 4d51beac..d4746d2e 100644 --- a/reflectivity_ui/ui/ui_main_window-edit.ui +++ b/quicknxs/ui/ui_main_window-edit.ui @@ -4599,13 +4599,13 @@ MPLWidget QWidget -
reflectivity_ui/ui/mplwidget.h
+
quicknxs/ui/mplwidget.h
1
CompareWidget QWidget -
reflectivity_ui/ui/compare_plots.h
+
quicknxs/ui/compare_plots.h
1
diff --git a/reflectivity_ui/ui/ui_main_window.ui b/quicknxs/ui/ui_main_window.ui similarity index 99% rename from reflectivity_ui/ui/ui_main_window.ui rename to quicknxs/ui/ui_main_window.ui index c7728ecf..dab00f64 100644 --- a/reflectivity_ui/ui/ui_main_window.ui +++ b/quicknxs/ui/ui_main_window.ui @@ -5680,19 +5680,19 @@ MPLWidget QWidget -
reflectivity_ui/ui/mplwidget.h
+
quicknxs/ui/mplwidget.h
1
CompareWidget QWidget -
reflectivity_ui/ui/compare_plots.h
+
quicknxs/ui/compare_plots.h
1
DeadTimeEntryPoint QGroupBox -
reflectivity_ui/ui/deadtime_entry.h
+
quicknxs/ui/deadtime_entry.h
1
diff --git a/reflectivity_ui/ui/ui_reduce_dialog.ui b/quicknxs/ui/ui_reduce_dialog.ui similarity index 100% rename from reflectivity_ui/ui/ui_reduce_dialog.ui rename to quicknxs/ui/ui_reduce_dialog.ui diff --git a/reflectivity_ui/ui/ui_result_viewer.ui b/quicknxs/ui/ui_result_viewer.ui similarity index 99% rename from reflectivity_ui/ui/ui_result_viewer.ui rename to quicknxs/ui/ui_result_viewer.ui index a573b2d0..34ee6e56 100644 --- a/reflectivity_ui/ui/ui_result_viewer.ui +++ b/quicknxs/ui/ui_result_viewer.ui @@ -428,14 +428,14 @@ CompareWidget QWidget -
reflectivity_ui/ui/compare_plots.h
+
quicknxs/ui/compare_plots.h
1
MPLWidget QWidget QWidget -
reflectivity_ui/ui/mplwidget.h
+
quicknxs/ui/mplwidget.h
1
diff --git a/reflectivity_ui/ui/ui_smooth_dialog.ui b/quicknxs/ui/ui_smooth_dialog.ui similarity index 99% rename from reflectivity_ui/ui/ui_smooth_dialog.ui rename to quicknxs/ui/ui_smooth_dialog.ui index 986dcd70..c9ce2cb7 100644 --- a/reflectivity_ui/ui/ui_smooth_dialog.ui +++ b/quicknxs/ui/ui_smooth_dialog.ui @@ -446,7 +446,7 @@ MPLWidget QWidget -
reflectivity_ui/ui/mplwidget.h
+
quicknxs/ui/mplwidget.h
1
diff --git a/setup.cfg b/setup.cfg index fbc28043..79dfa340 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,8 +1,8 @@ [metadata] -name = reflectivity_ui +name = quicknxs description = Magnetic Reflectivity Reduction author = SAE team -url = https://github.com/neutrons/reflectivity_ui +url = https://github.com/neutrons/quicknxs long_description = file: README.md license = Apache License 2.0 classifiers = @@ -44,7 +44,7 @@ ignore = E402 E722 E741 F821 F841 E203 W503 F401 E712 E713 F811 max-line-length = 150 [coverage:run] -source = reflectivity_ui +source = quicknxs omit = test/* [pytest] diff --git a/test/README.md b/test/README.md index 99c0dbae..8253ab16 100644 --- a/test/README.md +++ b/test/README.md @@ -1,10 +1,10 @@ A series of notebooks are available to see comparison plots between this version of QuickNXS and the old version. * The following is a mix of comparisons of specular and off-specular data with various options: -http://nbviewer.jupyter.org/github/mdoucet/reflectivity_ui/blob/master/test/comparison/general_comparison.ipynb +http://nbviewer.jupyter.org/github/mdoucet/quicknxs/blob/master/test/comparison/general_comparison.ipynb * The following shows comparison plots for off-specular data: -http://nbviewer.jupyter.org/github/mdoucet/reflectivity_ui/blob/master/test/comparison/Offspec_comparison.ipynb +http://nbviewer.jupyter.org/github/mdoucet/quicknxs/blob/master/test/comparison/Offspec_comparison.ipynb * The following shows comparison plots for GISANS data: -http://nbviewer.jupyter.org/github/mdoucet/reflectivity_ui/blob/master/test/comparison/gisans_comparison.ipynb +http://nbviewer.jupyter.org/github/mdoucet/quicknxs/blob/master/test/comparison/gisans_comparison.ipynb diff --git a/test/comparison/Offspec_comparison.ipynb b/test/comparison/Offspec_comparison.ipynb index 72f8d7ed..24953a8e 100644 --- a/test/comparison/Offspec_comparison.ipynb +++ b/test/comparison/Offspec_comparison.ipynb @@ -136,14 +136,14 @@ "text": [ "\n", "\n", - "File: /SNS/users/m2d/git/reflectivity_ui/test/comparison/v1/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off.dat\n", + "File: /SNS/users/m2d/git/quicknxs/test/comparison/v1/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off.dat\n", "Binning: 84 282 [23688]\n", "Scale = 3.602153\n", "Const value = 0.0001807229\n", "Width = 5\n", "\n", "\n", - "File: /SNS/users/m2d/git/reflectivity_ui/test/comparison/v2/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off.dat\n", + "File: /SNS/users/m2d/git/quicknxs/test/comparison/v2/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off.dat\n", "Binning: 84 282 [23688]\n", "Scale = 3.48616\n", "Const value = 0.000180723\n", @@ -166,8 +166,8 @@ "source": [ "# Center 2 are 41 and 42\n", "\n", - "plot_slice(['/SNS/users/m2d/git/reflectivity_ui/test/comparison/v1/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off.dat',\n", - " '/SNS/users/m2d/git/reflectivity_ui/test/comparison/v2/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off.dat'],\n", + "plot_slice(['/SNS/users/m2d/git/quicknxs/test/comparison/v1/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off.dat',\n", + " '/SNS/users/m2d/git/quicknxs/test/comparison/v2/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off.dat'],\n", " index=42, q_axis=True, width=5)\n" ] }, @@ -189,7 +189,7 @@ "text": [ "\n", "\n", - "File: /SNS/users/m2d/git/reflectivity_ui/test/comparison/v1/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off.dat\n", + "File: /SNS/users/m2d/git/quicknxs/test/comparison/v1/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off.dat\n", "Binning: 84 282 [23688]\n", "Scale = 3.602153\n", "Const value = 0.01210843\n", @@ -210,7 +210,7 @@ } ], "source": [ - "_, dk, qz, off_spec = load_data('/SNS/users/m2d/git/reflectivity_ui/test/comparison/v1/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off.dat')\n", + "_, dk, qz, off_spec = load_data('/SNS/users/m2d/git/quicknxs/test/comparison/v1/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off.dat')\n", "\n", "plot_heatmap(dk, qz, np.log(off_spec), x_title='', y_title='', surface=False,\n", " x_log=False, y_log=False)" @@ -234,7 +234,7 @@ "text": [ "\n", "\n", - "File: /SNS/users/m2d/git/reflectivity_ui/test/comparison/v2/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off.dat\n", + "File: /SNS/users/m2d/git/quicknxs/test/comparison/v2/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off.dat\n", "Binning: 84 282 [23688]\n", "Scale = 3.48616\n", "Const value = 0.0121084\n", @@ -255,7 +255,7 @@ } ], "source": [ - "_, dk, qz, off_spec = load_data('/SNS/users/m2d/git/reflectivity_ui/test/comparison/v2/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off.dat')\n", + "_, dk, qz, off_spec = load_data('/SNS/users/m2d/git/quicknxs/test/comparison/v2/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off.dat')\n", "\n", "plot_heatmap(dk, qz, np.log(off_spec), x_title='', y_title='', surface=False,\n", " x_log=False, y_log=False)" diff --git a/test/comparison/general_comparison.ipynb b/test/comparison/general_comparison.ipynb index 712639de..5d009a52 100644 --- a/test/comparison/general_comparison.ipynb +++ b/test/comparison/general_comparison.ipynb @@ -65,7 +65,7 @@ ], "source": [ "import sys\n", - "sys.path.append(\"/SNS/users/m2d/git/reflectivity_ui/test/notebooks\")\n", + "sys.path.append(\"/SNS/users/m2d/git/quicknxs/test/notebooks\")\n", "from plot_utils import plot1d, plot_heatmap" ] }, @@ -1165,12 +1165,12 @@ } ], "source": [ - "sangle_v2_path = '/SNS/users/m2d/git/reflectivity_ui/test/comparison/v2/REF_M_30806_Specular_Off_Off_SANGLE.dat'\n", - "dangle_v2_path = '/SNS/users/m2d/git/reflectivity_ui/test/comparison/v2/REF_M_30806_Specular_Off_Off_DANGLE.dat'\n", + "sangle_v2_path = '/SNS/users/m2d/git/quicknxs/test/comparison/v2/REF_M_30806_Specular_Off_Off_SANGLE.dat'\n", + "dangle_v2_path = '/SNS/users/m2d/git/quicknxs/test/comparison/v2/REF_M_30806_Specular_Off_Off_DANGLE.dat'\n", "sangle_v2 = np.loadtxt(sangle_v2_path).T\n", "dangle_v2 = np.loadtxt(dangle_v2_path).T\n", - "sangle_v1_path = '/SNS/users/m2d/git/reflectivity_ui/test/comparison/v1/REF_M_30806_Specular_Off_Off_SANGLE.dat'\n", - "dangle_v1_path = '/SNS/users/m2d/git/reflectivity_ui/test/comparison/v1/REF_M_30806_Specular_Off_Off_DANGLE.dat'\n", + "sangle_v1_path = '/SNS/users/m2d/git/quicknxs/test/comparison/v1/REF_M_30806_Specular_Off_Off_SANGLE.dat'\n", + "dangle_v1_path = '/SNS/users/m2d/git/quicknxs/test/comparison/v1/REF_M_30806_Specular_Off_Off_DANGLE.dat'\n", "sangle_v1 = np.loadtxt(sangle_v1_path).T\n", "dangle_v1 = np.loadtxt(dangle_v1_path).T\n", "\n", @@ -1201,7 +1201,7 @@ "text": [ "\n", "\n", - "File: /SNS/users/m2d/git/reflectivity_ui/test/comparison/v1/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off_set_1.dat\n", + "File: /SNS/users/m2d/git/quicknxs/test/comparison/v1/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off_set_1.dat\n", "Binning: 84 282 [23688]\n", "# Datafile created by QuickNXS 1.1.6\n", "# Date: 2019-01-09 13:30:17\n", @@ -25922,7 +25922,7 @@ } ], "source": [ - "filepath = '/SNS/users/m2d/git/reflectivity_ui/test/comparison/v1/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off_set_1.dat'\n", + "filepath = '/SNS/users/m2d/git/quicknxs/test/comparison/v1/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off_set_1.dat'\n", "dk, qz, off_spec = load_data(filepath, ncols=3)\n", "\n", "plot_heatmap(dk, qz, np.log(off_spec), x_title='kf_z-ki_i', y_title='Qz', surface=False,\n", @@ -25940,7 +25940,7 @@ "text": [ "\n", "\n", - "File: /SNS/users/m2d/git/reflectivity_ui/test/comparison/v2/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off_set_1.dat\n", + "File: /SNS/users/m2d/git/quicknxs/test/comparison/v2/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off_set_1.dat\n", "Binning: 84 282 [23688]\n", "# Datafile created by QuickNXS 2.0.31\n", "# Datafile created using Mantid 3.13.20190108.2020\n", @@ -50661,7 +50661,7 @@ } ], "source": [ - "filepath = '/SNS/users/m2d/git/reflectivity_ui/test/comparison/v2/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off_set_1.dat'\n", + "filepath = '/SNS/users/m2d/git/quicknxs/test/comparison/v2/REF_M_30806+30807+30808_OffSpecSmooth_Off_Off_set_1.dat'\n", "dk_v2, qz_v2, off_spec_v2 = load_data(filepath, ncols=3)\n", "\n", "plot_heatmap(qz, dk, np.log(off_spec), x_title='kf_z-ki_i', y_title='Qz', surface=False,\n", @@ -53619,9 +53619,9 @@ ], "source": [ "# Using DANGLE in both cases\n", - "v2_path = '/SNS/users/m2d/git/reflectivity_ui/test/comparison/v2/REF_M_30806+30807+30808_Specular_Off_Off_set_1.dat'\n", + "v2_path = '/SNS/users/m2d/git/quicknxs/test/comparison/v2/REF_M_30806+30807+30808_Specular_Off_Off_set_1.dat'\n", "v2 = np.loadtxt(v2_path).T\n", - "v1_path = '/SNS/users/m2d/git/reflectivity_ui/test/comparison/v1/REF_M_30806+30807+30808_Specular_Off_Off_set_1.dat'\n", + "v1_path = '/SNS/users/m2d/git/quicknxs/test/comparison/v1/REF_M_30806+30807+30808_Specular_Off_Off_set_1.dat'\n", "v1 = np.loadtxt(v1_path).T\n", "\n", "plot1d([[v2[0], v2[1], v2[2]],\n", @@ -55002,9 +55002,9 @@ ], "source": [ "# Using DANGLE in both cases\n", - "v2_path = '/SNS/users/m2d/git/reflectivity_ui/test/comparison/v2/REF_M_30889+30890+30891_Specular_Off_Off_v2.dat'\n", + "v2_path = '/SNS/users/m2d/git/quicknxs/test/comparison/v2/REF_M_30889+30890+30891_Specular_Off_Off_v2.dat'\n", "v2 = np.loadtxt(v2_path).T\n", - "v1_path = '/SNS/users/m2d/git/reflectivity_ui/test/comparison/v1/REF_M_30889+30890+30891_Specular_Off_Off.dat'\n", + "v1_path = '/SNS/users/m2d/git/quicknxs/test/comparison/v1/REF_M_30889+30890+30891_Specular_Off_Off.dat'\n", "v1 = np.loadtxt(v1_path).T\n", "\n", "plot1d([[v2[0], v2[1], v2[2]],\n", diff --git a/test/comparison/gisans_comparison.ipynb b/test/comparison/gisans_comparison.ipynb index 12bd8d12..eac4696e 100644 --- a/test/comparison/gisans_comparison.ipynb +++ b/test/comparison/gisans_comparison.ipynb @@ -67,7 +67,7 @@ ], "source": [ "import sys\n", - "sys.path.append(\"/SNS/users/m2d/git/reflectivity_ui/test/notebooks\")\n", + "sys.path.append(\"/SNS/users/m2d/git/quicknxs/test/notebooks\")\n", "from plot_utils import plot1d, plot_heatmap" ] }, @@ -134,7 +134,7 @@ "text": [ "\n", "\n", - "File: /SNS/users/m2d/git/reflectivity_ui/test/comparison/v1/REF_M_30806+30807+30808_GISANS_3.000-5.500_Off_Off_set_1.dat\n", + "File: /SNS/users/m2d/git/quicknxs/test/comparison/v1/REF_M_30806+30807+30808_GISANS_3.000-5.500_Off_Off_set_1.dat\n", "Binning: 51 76 [3876]\n", "# Datafile created by QuickNXS 1.1.6\n", "# Date: 2019-01-09 13:30:14\n", @@ -4392,7 +4392,7 @@ } ], "source": [ - "filepath = '/SNS/users/m2d/git/reflectivity_ui/test/comparison/v1/REF_M_30806+30807+30808_GISANS_3.000-5.500_Off_Off_set_1.dat'\n", + "filepath = '/SNS/users/m2d/git/quicknxs/test/comparison/v1/REF_M_30806+30807+30808_GISANS_3.000-5.500_Off_Off_set_1.dat'\n", "qy, qz, off_spec_band1_v1 = load_data(filepath, ncols=4)\n", "\n", "plot_heatmap(qy, qz, np.log(off_spec_band1_v1).T, x_title='Qy', y_title='Qz', surface=False,\n", @@ -4417,7 +4417,7 @@ "text": [ "\n", "\n", - "File: /SNS/users/m2d/git/reflectivity_ui/test/comparison/v2/REF_M_30806+30807+30808_GISANS_3.000-5.500_Off-Off_set_1.dat\n", + "File: /SNS/users/m2d/git/quicknxs/test/comparison/v2/REF_M_30806+30807+30808_GISANS_3.000-5.500_Off-Off_set_1.dat\n", "Binning: 51 76 [3876]\n", "# Datafile created by QuickNXS 2.0.31\n", "# Datafile created using Mantid 3.13.20190108.2020\n", @@ -8675,7 +8675,7 @@ } ], "source": [ - "filepath = '/SNS/users/m2d/git/reflectivity_ui/test/comparison/v2/REF_M_30806+30807+30808_GISANS_3.000-5.500_Off-Off_set_1.dat'\n", + "filepath = '/SNS/users/m2d/git/quicknxs/test/comparison/v2/REF_M_30806+30807+30808_GISANS_3.000-5.500_Off-Off_set_1.dat'\n", "qy_v2, qz_v2, off_spec_band1_v2 = load_data(filepath, ncols=4)\n", "\n", "plot_heatmap(qy_v2, qz_v2, np.log(off_spec_band1_v2).T, x_title='Qy', y_title='Qz', surface=False,\n", @@ -9324,7 +9324,7 @@ "text": [ "\n", "\n", - "File: /SNS/users/m2d/git/reflectivity_ui/test/comparison/v1/REF_M_30806+30807+30808_GISANS_5.500-8.000_Off_Off_set_1.dat\n", + "File: /SNS/users/m2d/git/quicknxs/test/comparison/v1/REF_M_30806+30807+30808_GISANS_5.500-8.000_Off_Off_set_1.dat\n", "Binning: 51 76 [3876]\n", "# Datafile created by QuickNXS 1.1.6\n", "# Date: 2019-01-09 13:30:14\n", @@ -13582,7 +13582,7 @@ } ], "source": [ - "filepath = '/SNS/users/m2d/git/reflectivity_ui/test/comparison/v1/REF_M_30806+30807+30808_GISANS_5.500-8.000_Off_Off_set_1.dat'\n", + "filepath = '/SNS/users/m2d/git/quicknxs/test/comparison/v1/REF_M_30806+30807+30808_GISANS_5.500-8.000_Off_Off_set_1.dat'\n", "\n", "qy_band2_v1, qz_band2_v1, off_spec_band2_v1 = load_data(filepath, ncols=4)\n", "\n", @@ -13608,7 +13608,7 @@ "text": [ "\n", "\n", - "File: /SNS/users/m2d/git/reflectivity_ui/test/comparison/v2/REF_M_30806+30807+30808_GISANS_5.500-8.000_Off-Off_set_1.dat\n", + "File: /SNS/users/m2d/git/quicknxs/test/comparison/v2/REF_M_30806+30807+30808_GISANS_5.500-8.000_Off-Off_set_1.dat\n", "Binning: 51 76 [3876]\n", "# Datafile created by QuickNXS 2.0.31\n", "# Datafile created using Mantid 3.13.20190108.2020\n", @@ -17866,7 +17866,7 @@ } ], "source": [ - "filepath = '/SNS/users/m2d/git/reflectivity_ui/test/comparison/v2/REF_M_30806+30807+30808_GISANS_5.500-8.000_Off-Off_set_1.dat'\n", + "filepath = '/SNS/users/m2d/git/quicknxs/test/comparison/v2/REF_M_30806+30807+30808_GISANS_5.500-8.000_Off-Off_set_1.dat'\n", "qy_band2_v2, qz_band2_v2, off_spec_band2_v2 = load_data(filepath, ncols=4)\n", "\n", "plot_heatmap(qy_band2_v2, qz_band2_v2, np.log(off_spec_band2_v2).T, x_title='Qy', y_title='Qz', surface=False,\n", diff --git a/test/comparison/readme.md b/test/comparison/readme.md index 99c0dbae..8253ab16 100644 --- a/test/comparison/readme.md +++ b/test/comparison/readme.md @@ -1,10 +1,10 @@ A series of notebooks are available to see comparison plots between this version of QuickNXS and the old version. * The following is a mix of comparisons of specular and off-specular data with various options: -http://nbviewer.jupyter.org/github/mdoucet/reflectivity_ui/blob/master/test/comparison/general_comparison.ipynb +http://nbviewer.jupyter.org/github/mdoucet/quicknxs/blob/master/test/comparison/general_comparison.ipynb * The following shows comparison plots for off-specular data: -http://nbviewer.jupyter.org/github/mdoucet/reflectivity_ui/blob/master/test/comparison/Offspec_comparison.ipynb +http://nbviewer.jupyter.org/github/mdoucet/quicknxs/blob/master/test/comparison/Offspec_comparison.ipynb * The following shows comparison plots for GISANS data: -http://nbviewer.jupyter.org/github/mdoucet/reflectivity_ui/blob/master/test/comparison/gisans_comparison.ipynb +http://nbviewer.jupyter.org/github/mdoucet/quicknxs/blob/master/test/comparison/gisans_comparison.ipynb diff --git a/test/conftest.py b/test/conftest.py index 42c6f786..48073622 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -12,8 +12,8 @@ import pytest from PyQt5.QtCore import QSettings -from reflectivity_ui.interfaces.data_handling.filepath import FilePath, RunNumbers -from reflectivity_ui.interfaces.data_handling.instrument import Instrument +from quicknxs.interfaces.data_handling.filepath import FilePath, RunNumbers +from quicknxs.interfaces.data_handling.instrument import Instrument pytest_plugins = ["mantid.fixtures"] @@ -48,7 +48,7 @@ def DATA_DIR(): return Path(__file__).parent / "data" -Instrument.file_search_template = str(Path(__file__).parent / "data" / "reflectivity_ui-data" / "REF_M_%s") +Instrument.file_search_template = str(Path(__file__).parent / "data" / "quicknxs-data" / "REF_M_%s") @pytest.fixture(scope="module") @@ -58,7 +58,7 @@ def data_server(DATA_DIR): class _DataServe(object): _directory = str(DATA_DIR) - _h5_path = "reflectivity_ui-data" + _h5_path = "quicknxs-data" @property def directory(self): @@ -81,7 +81,7 @@ def path_to(self, basename): file_path = os.path.join(self._directory, basename) if os.path.isfile(file_path): return file_path - # looking in test/data/reflectivity_ui-data + # looking in test/data/quicknxs-data file_path = os.path.join(self.directory, self.h5_path) file_path = os.path.join(file_path, basename) diff --git a/test/data/quicknxs-data b/test/data/quicknxs-data new file mode 160000 index 00000000..8d3ce6e0 --- /dev/null +++ b/test/data/quicknxs-data @@ -0,0 +1 @@ +Subproject commit 8d3ce6e03bf518f661e7ebcf83818dfc0113f95e diff --git a/test/data/reflectivity_ui-data b/test/data/reflectivity_ui-data deleted file mode 160000 index 702ae752..00000000 --- a/test/data/reflectivity_ui-data +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 702ae7524589c371fa3e6c2901e8f29b021d178c diff --git a/test/notebooks/benchmarking.ipynb b/test/notebooks/benchmarking.ipynb index c3708ce1..ed1ab00d 100644 --- a/test/notebooks/benchmarking.ipynb +++ b/test/notebooks/benchmarking.ipynb @@ -71,7 +71,7 @@ ], "source": [ "import sys\n", - "sys.path.append(\"/SNS/users/m2d/git/reflectivity_ui/test/notebooks\")\n", + "sys.path.append(\"/SNS/users/m2d/git/quicknxs/test/notebooks\")\n", "from plot_utils import plot1d, plot_heatmap" ] }, @@ -144,7 +144,7 @@ "(23688, 3)\n", "\n", "\n", - "File: /SNS/users/m2d/git/reflectivity_ui/test/notebooks/data/REF_M_30889+30890_OffSpecSmooth_Off_Off_v2_TOF_400.dat\n", + "File: /SNS/users/m2d/git/quicknxs/test/notebooks/data/REF_M_30889+30890_OffSpecSmooth_Off_Off_v2_TOF_400.dat\n", "Binning: 84 282 [23688]\n", "Scale = 9.30532\n", "Const value = 0.000180723\n", @@ -24864,7 +24864,7 @@ } ], "source": [ - "_spec_400, dk, qz, off_spec = load_data('/SNS/users/m2d/git/reflectivity_ui/test/notebooks/data/REF_M_30889+30890_OffSpecSmooth_Off_Off_v2_TOF_400.dat',\n", + "_spec_400, dk, qz, off_spec = load_data('/SNS/users/m2d/git/quicknxs/test/notebooks/data/REF_M_30889+30890_OffSpecSmooth_Off_Off_v2_TOF_400.dat',\n", " index=42, q_axis=True, width=5)\n", "\n", "plot_heatmap(dk, qz, np.log(off_spec), x_title='', y_title='', surface=False,\n", @@ -24890,7 +24890,7 @@ "(23688, 4)\n", "\n", "\n", - "File: /SNS/users/m2d/git/reflectivity_ui/test/notebooks/data/REF_M_30889+30890_OffSpecBinned_Off_Off_v2_TOF_400.dat\n", + "File: /SNS/users/m2d/git/quicknxs/test/notebooks/data/REF_M_30889+30890_OffSpecBinned_Off_Off_v2_TOF_400.dat\n", "Binning: 84 282 [23688]\n", "Scale = 10.7166\n", "Const value = 0.000178571\n", @@ -49610,7 +49610,7 @@ } ], "source": [ - "_spec_binned_400, dk, qz, off_spec = load_data('/SNS/users/m2d/git/reflectivity_ui/test/notebooks/data/REF_M_30889+30890_OffSpecBinned_Off_Off_v2_TOF_400.dat',\n", + "_spec_binned_400, dk, qz, off_spec = load_data('/SNS/users/m2d/git/quicknxs/test/notebooks/data/REF_M_30889+30890_OffSpecBinned_Off_Off_v2_TOF_400.dat',\n", " index=42, q_axis=True, width=5)\n", "\n", "plot_heatmap(dk, qz, np.log(off_spec), x_title='', y_title='', surface=False,\n", @@ -49636,7 +49636,7 @@ "(23688, 3)\n", "\n", "\n", - "File: /SNS/users/m2d/git/reflectivity_ui/test/notebooks/data/REF_M_30889+30890_OffSpecSmooth_Off_Off_v2_TOF_40.dat\n", + "File: /SNS/users/m2d/git/quicknxs/test/notebooks/data/REF_M_30889+30890_OffSpecSmooth_Off_Off_v2_TOF_40.dat\n", "Binning: 84 282 [23688]\n", "Scale = 8.62366\n", "Const value = 0.000180723\n", @@ -74356,7 +74356,7 @@ } ], "source": [ - "_spec_40, dk, qz, off_spec = load_data('/SNS/users/m2d/git/reflectivity_ui/test/notebooks/data/REF_M_30889+30890_OffSpecSmooth_Off_Off_v2_TOF_40.dat',\n", + "_spec_40, dk, qz, off_spec = load_data('/SNS/users/m2d/git/quicknxs/test/notebooks/data/REF_M_30889+30890_OffSpecSmooth_Off_Off_v2_TOF_40.dat',\n", " index=42, q_axis=True, width=5)\n", "\n", "plot_heatmap(dk, qz, np.log(off_spec), x_title='', y_title='', surface=False,\n", @@ -74384,7 +74384,7 @@ "(23688, 4)\n", "\n", "\n", - "File: /SNS/users/m2d/git/reflectivity_ui/test/notebooks/data/REF_M_30889+30890_OffSpecBinned_Off_Off_v2_TOF_40.dat\n", + "File: /SNS/users/m2d/git/quicknxs/test/notebooks/data/REF_M_30889+30890_OffSpecBinned_Off_Off_v2_TOF_40.dat\n", "Binning: 84 282 [23688]\n", "Scale = 10.6088\n", "Const value = 0.000178571\n", @@ -99104,7 +99104,7 @@ } ], "source": [ - "_spec_binned_40, dk, qz, off_spec = load_data('/SNS/users/m2d/git/reflectivity_ui/test/notebooks/data/REF_M_30889+30890_OffSpecBinned_Off_Off_v2_TOF_40.dat',\n", + "_spec_binned_40, dk, qz, off_spec = load_data('/SNS/users/m2d/git/quicknxs/test/notebooks/data/REF_M_30889+30890_OffSpecBinned_Off_Off_v2_TOF_40.dat',\n", " index=42, q_axis=True, width=10)\n", "\n", "plot_heatmap(dk, qz, np.log(off_spec), x_title='', y_title='', surface=False,\n", @@ -102890,10 +102890,10 @@ } ], "source": [ - "refl_400_cstq = np.loadtxt('/SNS/users/m2d/git/reflectivity_ui/test/notebooks/data/REF_M_30889+30890_Specular_Off_Off_CSTQ_v2_TOF_400.dat')\n", - "refl_40_cstq = np.loadtxt('/SNS/users/m2d/git/reflectivity_ui/test/notebooks/data/REF_M_30889+30890_Specular_Off_Off_CSTQ_v2_TOF_40.dat')\n", - "refl_400 = np.loadtxt('/SNS/users/m2d/git/reflectivity_ui/test/notebooks/data/REF_M_30889+30890_Specular_Off_Off_v2_TOF_400.dat')\n", - "refl_40 = np.loadtxt('/SNS/users/m2d/git/reflectivity_ui/test/notebooks/data/REF_M_30889+30890_Specular_Off_Off_v2_TOF_40.dat')\n", + "refl_400_cstq = np.loadtxt('/SNS/users/m2d/git/quicknxs/test/notebooks/data/REF_M_30889+30890_Specular_Off_Off_CSTQ_v2_TOF_400.dat')\n", + "refl_40_cstq = np.loadtxt('/SNS/users/m2d/git/quicknxs/test/notebooks/data/REF_M_30889+30890_Specular_Off_Off_CSTQ_v2_TOF_40.dat')\n", + "refl_400 = np.loadtxt('/SNS/users/m2d/git/quicknxs/test/notebooks/data/REF_M_30889+30890_Specular_Off_Off_v2_TOF_400.dat')\n", + "refl_40 = np.loadtxt('/SNS/users/m2d/git/quicknxs/test/notebooks/data/REF_M_30889+30890_Specular_Off_Off_v2_TOF_40.dat')\n", "\n", "_scale = 1.0/2.8\n", "_plot_list = [[_spec_400[0], _scale*_spec_400[1]],\n", diff --git a/test/notebooks/datasets.py b/test/notebooks/datasets.py index d06d21e5..80d30655 100644 --- a/test/notebooks/datasets.py +++ b/test/notebooks/datasets.py @@ -8,9 +8,9 @@ sc="REF_M_30889", db="30886", path="/SNS/REF_M/IPTS-21391/nexus/REF_M_30889.nxs.h5", - ref="/SNS/users/m2d/git/reflectivity_ui/test/notebooks/data/REF_M_30889+30890_Specular_Off_Off_v2_TOF_40.dat", + ref="/SNS/users/m2d/git/quicknxs/test/notebooks/data/REF_M_30889+30890_Specular_Off_Off_v2_TOF_40.dat", # refcst='/SNS/users/m2d/MR/reflectivity_30889.txt', - refcst="/SNS/users/m2d/git/reflectivity_ui/test/notebooks/data/REF_M_30889+30890_Specular_Off_Off_CSTQ_v2_TOF_40.dat", + refcst="/SNS/users/m2d/git/quicknxs/test/notebooks/data/REF_M_30889+30890_Specular_Off_Off_CSTQ_v2_TOF_40.dat", peak_pos=157.5, peak=[149, 167], bck=[47, 105], diff --git a/test/notebooks/event_reduction.py b/test/notebooks/event_reduction.py index 3b5315a6..d4ffe2f6 100644 --- a/test/notebooks/event_reduction.py +++ b/test/notebooks/event_reduction.py @@ -6,7 +6,7 @@ import numpy as np -from reflectivity_ui.interfaces.data_handling import instrument +from quicknxs.interfaces.data_handling import instrument def load_data(run="REF_M_30769"): diff --git a/test/notebooks/events_based_reduction.ipynb b/test/notebooks/events_based_reduction.ipynb index 9ac1c47d..bc384746 100644 --- a/test/notebooks/events_based_reduction.ipynb +++ b/test/notebooks/events_based_reduction.ipynb @@ -61,7 +61,7 @@ ], "source": [ "import sys\n", - "sys.path.append(\"/SNS/users/m2d/git/reflectivity_ui/test/notebooks\")\n", + "sys.path.append(\"/SNS/users/m2d/git/quicknxs/test/notebooks\")\n", "from plot_utils import plot1d, plot_heatmap\n", "import mantid\n", "import mantid.simpleapi as api" @@ -75,7 +75,7 @@ { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 5, diff --git a/test/ui/test_deadtime_entry.py b/test/ui/test_deadtime_entry.py index ab80b66c..db85df5d 100644 --- a/test/ui/test_deadtime_entry.py +++ b/test/ui/test_deadtime_entry.py @@ -4,9 +4,9 @@ from qtpy.QtWidgets import QApplication, QDialogButtonBox # local imports -from reflectivity_ui.interfaces.configuration import Configuration -from reflectivity_ui.interfaces.main_window import MainWindow -from reflectivity_ui.ui.deadtime_entry import DeadTimeEntryPoint # Make sure to import your class correctly +from quicknxs.interfaces.configuration import Configuration +from quicknxs.interfaces.main_window import MainWindow +from quicknxs.ui.deadtime_entry import DeadTimeEntryPoint # Make sure to import your class correctly from test.ui import ui_utilities @@ -25,7 +25,7 @@ def test_initial_state(dead_time_entry_point): def test_checkbox_interaction(mocker, dead_time_entry_point, qtbot): # Mock modal dialog mocker.patch( - "reflectivity_ui.ui.deadtime_entry.DeadTimeEntryPoint.VerifyChangeCheckBox.ask_user_ok_to_reload_files", + "quicknxs.ui.deadtime_entry.DeadTimeEntryPoint.VerifyChangeCheckBox.ask_user_ok_to_reload_files", return_value=True, ) # Simulate checking the checkbox @@ -39,7 +39,7 @@ def test_checkbox_interaction(mocker, dead_time_entry_point, qtbot): def test_uncheck_checkbox(mocker, dead_time_entry_point, qtbot): # Mock modal dialog mocker.patch( - "reflectivity_ui.ui.deadtime_entry.DeadTimeEntryPoint.VerifyChangeCheckBox.ask_user_ok_to_reload_files", + "quicknxs.ui.deadtime_entry.DeadTimeEntryPoint.VerifyChangeCheckBox.ask_user_ok_to_reload_files", return_value=True, ) # First, check the checkbox @@ -56,10 +56,10 @@ def test_uncheck_checkbox(mocker, dead_time_entry_point, qtbot): def test_checkbox_change_reload_files(mocker, qtbot): # Mock modal dialog mocker.patch( - "reflectivity_ui.ui.deadtime_entry.DeadTimeEntryPoint.VerifyChangeCheckBox.ask_user_ok_to_reload_files", + "quicknxs.ui.deadtime_entry.DeadTimeEntryPoint.VerifyChangeCheckBox.ask_user_ok_to_reload_files", return_value=True, ) - mock_reload_files = mocker.patch("reflectivity_ui.interfaces.main_window.MainWindow.reload_all_files") + mock_reload_files = mocker.patch("quicknxs.interfaces.main_window.MainWindow.reload_all_files") # Initialize main window main_window = MainWindow() qtbot.addWidget(main_window) diff --git a/test/ui/test_deadtime_settings.py b/test/ui/test_deadtime_settings.py index 4aeca7e2..483d0921 100644 --- a/test/ui/test_deadtime_settings.py +++ b/test/ui/test_deadtime_settings.py @@ -1,6 +1,6 @@ # local imports -from reflectivity_ui.interfaces.configuration import Configuration -from reflectivity_ui.interfaces.main_window import MainWindow +from quicknxs.interfaces.configuration import Configuration +from quicknxs.interfaces.main_window import MainWindow # standard imports import unittest.mock as mock @@ -12,7 +12,7 @@ def test_show_deadtime_settings_default_values(mocker, qtbot): """Test showing the deadtime settings dialog and keeping the default values""" - mock_reload_files = mocker.patch("reflectivity_ui.interfaces.main_window.MainWindow.reload_all_files") + mock_reload_files = mocker.patch("quicknxs.interfaces.main_window.MainWindow.reload_all_files") main_window = MainWindow() qtbot.addWidget(main_window) Configuration.setup_default_values() @@ -34,10 +34,8 @@ def display_deadtime_settings(): def test_show_deadtime_settings_updated_values(mocker, qtbot): """Test showing the deadtime settings dialog and updating the values""" - mocker.patch( - "reflectivity_ui.ui.deadtime_settings.DeadTimeSettingsView.ask_user_ok_to_reload_files", return_value=True - ) - mock_reload_files = mocker.patch("reflectivity_ui.interfaces.main_window.MainWindow.reload_all_files") + mocker.patch("quicknxs.ui.deadtime_settings.DeadTimeSettingsView.ask_user_ok_to_reload_files", return_value=True) + mock_reload_files = mocker.patch("quicknxs.interfaces.main_window.MainWindow.reload_all_files") new_paralyzable = False new_dead_time = 5.0 diff --git a/test/ui/test_dialog_box.py b/test/ui/test_dialog_box.py index 33154a32..19214f09 100644 --- a/test/ui/test_dialog_box.py +++ b/test/ui/test_dialog_box.py @@ -1,4 +1,4 @@ -from reflectivity_ui.interfaces.event_handlers.widgets import AcceptRejectDialog +from quicknxs.interfaces.event_handlers.widgets import AcceptRejectDialog from PyQt5 import QtCore from PyQt5.QtWidgets import QPushButton diff --git a/test/ui/test_losing_direct_beam.py b/test/ui/test_losing_direct_beam.py index 5f992add..63c9ae63 100644 --- a/test/ui/test_losing_direct_beam.py +++ b/test/ui/test_losing_direct_beam.py @@ -1,5 +1,5 @@ # local imports -from reflectivity_ui.interfaces.main_window import MainWindow +from quicknxs.interfaces.main_window import MainWindow from test import SNS_REFM_MOUNTED from test.ui import ui_utilities diff --git a/test/ui/test_main_window.py b/test/ui/test_main_window.py index 091626b0..9a76874c 100644 --- a/test/ui/test_main_window.py +++ b/test/ui/test_main_window.py @@ -1,7 +1,7 @@ # local imports -from reflectivity_ui.interfaces.configuration import Configuration -from reflectivity_ui.interfaces.data_handling.data_set import CrossSectionData, NexusData -from reflectivity_ui.interfaces.main_window import MainWindow +from quicknxs.interfaces.configuration import Configuration +from quicknxs.interfaces.data_handling.data_set import CrossSectionData, NexusData +from quicknxs.interfaces.main_window import MainWindow from test.ui import ui_utilities # third party imports @@ -36,9 +36,9 @@ def test_set_global_stitching(self, qtbot): def test_active_channel(self, mocker, qtbot): """Test that selecting a cross-section radio button updates the active channel""" # mock updating the plots - mocker.patch("reflectivity_ui.interfaces.main_window.MainWindow.plotActiveTab", return_value=True) - mocker.patch("reflectivity_ui.interfaces.plotting.PlotManager.plot_refl", return_value=True) - mocker.patch("reflectivity_ui.interfaces.plotting.PlotManager.plot_projections", return_value=True) + mocker.patch("quicknxs.interfaces.main_window.MainWindow.plotActiveTab", return_value=True) + mocker.patch("quicknxs.interfaces.plotting.PlotManager.plot_refl", return_value=True) + mocker.patch("quicknxs.interfaces.plotting.PlotManager.plot_projections", return_value=True) # create the SUT window_main = MainWindow() @@ -65,9 +65,7 @@ def test_active_channel(self, mocker, qtbot): @pytest.mark.parametrize("table_widget", ["reductionTable", "normalizeTable"]) def test_reduction_table_right_click(self, table_widget, qtbot, mocker): - mock_save_run_data = mocker.patch( - "reflectivity_ui.interfaces.event_handlers.main_handler.MainHandler.save_run_data" - ) + mock_save_run_data = mocker.patch("quicknxs.interfaces.event_handlers.main_handler.MainHandler.save_run_data") window_main = MainWindow() qtbot.addWidget(window_main) window_main.data_manager.reduction_list = [NexusData("filepath", Configuration())] @@ -92,9 +90,9 @@ def test_global_vs_per_run(self, qtbot, mocker): """Test the global vs per run reduction variables""" # mock updating the plots - mocker.patch("reflectivity_ui.interfaces.main_window.MainWindow.plotActiveTab", return_value=True) - mocker.patch("reflectivity_ui.interfaces.plotting.PlotManager.plot_refl", return_value=True) - mocker.patch("reflectivity_ui.interfaces.plotting.PlotManager.plot_projections", return_value=True) + mocker.patch("quicknxs.interfaces.main_window.MainWindow.plotActiveTab", return_value=True) + mocker.patch("quicknxs.interfaces.plotting.PlotManager.plot_refl", return_value=True) + mocker.patch("quicknxs.interfaces.plotting.PlotManager.plot_projections", return_value=True) window_main = MainWindow() qtbot.addWidget(window_main) @@ -300,7 +298,7 @@ def _assert_tabs_visible(tab_ids: list[bool]): @pytest.mark.datarepo def test_change_active_data_tab(self, mocker, qtbot, data_server): """Test that the internal state is updated when the active data tab is changed""" - mock_plot_refl = mocker.patch("reflectivity_ui.interfaces.plotting.PlotManager.plot_refl", return_value=True) + mock_plot_refl = mocker.patch("quicknxs.interfaces.plotting.PlotManager.plot_refl", return_value=True) window_main = MainWindow() qtbot.addWidget(window_main) diff --git a/test/ui/test_missing_cross_section.py b/test/ui/test_missing_cross_section.py index 17836280..92f3ba44 100644 --- a/test/ui/test_missing_cross_section.py +++ b/test/ui/test_missing_cross_section.py @@ -1,6 +1,6 @@ # local imports -from reflectivity_ui.interfaces.configuration import Configuration -from reflectivity_ui.interfaces.main_window import MainWindow +from quicknxs.interfaces.configuration import Configuration +from quicknxs.interfaces.main_window import MainWindow from test.ui import ui_utilities # third party imports diff --git a/test/ui/test_mplwidget.py b/test/ui/test_mplwidget.py index 8849a1ad..45edc1ce 100644 --- a/test/ui/test_mplwidget.py +++ b/test/ui/test_mplwidget.py @@ -5,8 +5,8 @@ from matplotlib.collections import LineCollection from matplotlib.lines import Line2D -from reflectivity_ui.interfaces.main_window import MainWindow -from reflectivity_ui.ui.mplwidget import NavigationToolbarGeneric, NavigationToolbarReflectivity, NavigationToolbar +from quicknxs.interfaces.main_window import MainWindow +from quicknxs.ui.mplwidget import NavigationToolbarGeneric, NavigationToolbarReflectivity, NavigationToolbar def _refl_data(): diff --git a/test/ui/test_reflectivity_extraction_global.py b/test/ui/test_reflectivity_extraction_global.py index 4069193d..f2d2ea89 100644 --- a/test/ui/test_reflectivity_extraction_global.py +++ b/test/ui/test_reflectivity_extraction_global.py @@ -1,7 +1,7 @@ # local imports -from reflectivity_ui.interfaces.configuration import Configuration -from reflectivity_ui.interfaces.data_handling.data_set import NexusData, CrossSectionData -from reflectivity_ui.interfaces.main_window import MainWindow +from quicknxs.interfaces.configuration import Configuration +from quicknxs.interfaces.data_handling.data_set import NexusData, CrossSectionData +from quicknxs.interfaces.main_window import MainWindow from test.ui import ui_utilities diff --git a/test/ui/test_status_bar.py b/test/ui/test_status_bar.py index 8cf3c7d9..e53e7d70 100644 --- a/test/ui/test_status_bar.py +++ b/test/ui/test_status_bar.py @@ -1,7 +1,7 @@ import pytest -from reflectivity_ui.interfaces.event_handlers.progress_reporter import ProgressReporter -from reflectivity_ui.interfaces.main_window import MainWindow +from quicknxs.interfaces.event_handlers.progress_reporter import ProgressReporter +from quicknxs.interfaces.main_window import MainWindow class TestStatusBar: diff --git a/test/unit/reflectivity_ui/__init__.py b/test/unit/quicknxs/__init__.py similarity index 100% rename from test/unit/reflectivity_ui/__init__.py rename to test/unit/quicknxs/__init__.py diff --git a/test/unit/reflectivity_ui/config/test_settings.py b/test/unit/quicknxs/config/test_settings.py similarity index 92% rename from test/unit/reflectivity_ui/config/test_settings.py rename to test/unit/quicknxs/config/test_settings.py index b2f03e26..6acf867f 100644 --- a/test/unit/reflectivity_ui/config/test_settings.py +++ b/test/unit/quicknxs/config/test_settings.py @@ -1,5 +1,5 @@ # local imports -from reflectivity_ui.config import Settings +from quicknxs.config import Settings # 3rd-party imports import pytest diff --git a/test/unit/reflectivity_ui/interfaces/__init__.py b/test/unit/quicknxs/interfaces/__init__.py similarity index 100% rename from test/unit/reflectivity_ui/interfaces/__init__.py rename to test/unit/quicknxs/interfaces/__init__.py diff --git a/test/unit/reflectivity_ui/interfaces/data_handling/__init__.py b/test/unit/quicknxs/interfaces/data_handling/__init__.py similarity index 100% rename from test/unit/reflectivity_ui/interfaces/data_handling/__init__.py rename to test/unit/quicknxs/interfaces/data_handling/__init__.py diff --git a/test/unit/reflectivity_ui/interfaces/data_handling/test_data_manipulation.py b/test/unit/quicknxs/interfaces/data_handling/test_data_manipulation.py similarity index 91% rename from test/unit/reflectivity_ui/interfaces/data_handling/test_data_manipulation.py rename to test/unit/quicknxs/interfaces/data_handling/test_data_manipulation.py index f63adb54..ee05a52d 100644 --- a/test/unit/reflectivity_ui/interfaces/data_handling/test_data_manipulation.py +++ b/test/unit/quicknxs/interfaces/data_handling/test_data_manipulation.py @@ -1,13 +1,13 @@ # package imports -from reflectivity_ui.interfaces.configuration import Configuration -from reflectivity_ui.interfaces.data_handling.data_manipulation import ( +from quicknxs.interfaces.configuration import Configuration +from quicknxs.interfaces.data_handling.data_manipulation import ( NormalizeToUnityQCutoffError, _get_polynomial_fit_stitching_scaling_factor, _get_stitching_overlap_region, smart_stitch_reflectivity, ) -from reflectivity_ui.interfaces.data_handling.data_set import NexusData -from reflectivity_ui.interfaces.data_manager import DataManager +from quicknxs.interfaces.data_handling.data_set import NexusData +from quicknxs.interfaces.data_manager import DataManager # 3rd-party imports import copy @@ -26,15 +26,15 @@ "#\n" "# [Direct Beam Runs]\n" "# DB_ID P0 PN x_pos x_width y_pos y_width bg_pos bg_width dpix tth number File\n" # noqa: E501 - "# 1 0 0 195 12 126.5 155 55 24 194 0 42099 reflectivity_ui-data/REF_M_42099.nxs.h5\n" # noqa: E501 - "# 2 0 0 195 12 127 154 55 24 194 0 42100 reflectivity_ui-data/REF_M_42100.nxs.h5\n" # noqa: E501 - "# 3 0 0 195 12 127 154 55 24 194 0 42100 reflectivity_ui-data/REF_M_42100.nxs.h5\n" # noqa: E501 + "# 1 0 0 195 12 126.5 155 55 24 194 0 42099 quicknxs-data/REF_M_42099.nxs.h5\n" # noqa: E501 + "# 2 0 0 195 12 127 154 55 24 194 0 42100 quicknxs-data/REF_M_42100.nxs.h5\n" # noqa: E501 + "# 3 0 0 195 12 127 154 55 24 194 0 42100 quicknxs-data/REF_M_42100.nxs.h5\n" # noqa: E501 "#\n" "# [Data Runs]\n" "# scale P0 PN x_pos x_width y_pos y_width bg_pos bg_width fan dpix tth number DB_ID File\n" # noqa: E501 - "# 1 15 10 167 12 163.5 72.9 55 24 False 194 0.00653668 42112 1 reflectivity_ui-data/REF_M_42112.nxs.h5\n" # noqa: E501 - "# 0.183654 15 10 189.3 12 162.2 68.3 55 24 False 194 0.799577 42116 2 reflectivity_ui-data/REF_M_42116.nxs.h5\n" # noqa: E501 - "# 0.1375 15 10 167.5 12 159.9 67.4 55 24 False 194 0.798876 42113 3 reflectivity_ui-data/REF_M_42113.nxs.h5\n" # noqa: E501 + "# 1 15 10 167 12 163.5 72.9 55 24 False 194 0.00653668 42112 1 quicknxs-data/REF_M_42112.nxs.h5\n" # noqa: E501 + "# 0.183654 15 10 189.3 12 162.2 68.3 55 24 False 194 0.799577 42116 2 quicknxs-data/REF_M_42116.nxs.h5\n" # noqa: E501 + "# 0.1375 15 10 167.5 12 159.9 67.4 55 24 False 194 0.798876 42113 3 quicknxs-data/REF_M_42113.nxs.h5\n" # noqa: E501 "#\n" "# [Global Options]\n" "# name value\n" diff --git a/test/unit/reflectivity_ui/interfaces/data_handling/test_data_set.py b/test/unit/quicknxs/interfaces/data_handling/test_data_set.py similarity index 88% rename from test/unit/reflectivity_ui/interfaces/data_handling/test_data_set.py rename to test/unit/quicknxs/interfaces/data_handling/test_data_set.py index f746cf35..35d004b1 100644 --- a/test/unit/reflectivity_ui/interfaces/data_handling/test_data_set.py +++ b/test/unit/quicknxs/interfaces/data_handling/test_data_set.py @@ -1,8 +1,8 @@ import numpy as np import pytest -from reflectivity_ui.interfaces.configuration import Configuration -from reflectivity_ui.interfaces.data_handling.data_set import CrossSectionData +from quicknxs.interfaces.configuration import Configuration +from quicknxs.interfaces.data_handling.data_set import CrossSectionData def _get_cross_section_data(): @@ -37,7 +37,7 @@ def test_r_scaling_factor(self): def test_get_tof_counts_table(self, mocker): """Test of method get_tof_counts_table""" - mocker.patch("reflectivity_ui.interfaces.data_handling.data_set.CrossSectionData.prepare_plot_data") + mocker.patch("quicknxs.interfaces.data_handling.data_set.CrossSectionData.prepare_plot_data") rel_tol = 1e-6 xs = _get_cross_section_data() data_table, header = xs.get_tof_counts_table() diff --git a/test/unit/reflectivity_ui/interfaces/data_handling/test_dead_time_correction.py b/test/unit/quicknxs/interfaces/data_handling/test_dead_time_correction.py similarity index 79% rename from test/unit/reflectivity_ui/interfaces/data_handling/test_dead_time_correction.py rename to test/unit/quicknxs/interfaces/data_handling/test_dead_time_correction.py index c7732631..57765b27 100644 --- a/test/unit/reflectivity_ui/interfaces/data_handling/test_dead_time_correction.py +++ b/test/unit/quicknxs/interfaces/data_handling/test_dead_time_correction.py @@ -1,6 +1,6 @@ # package imports -from reflectivity_ui.interfaces.data_handling.DeadTimeCorrection import SingleReadoutDeadTimeCorrection -from reflectivity_ui.interfaces.data_handling.instrument import mantid_algorithm_exec +from quicknxs.interfaces.data_handling.DeadTimeCorrection import SingleReadoutDeadTimeCorrection +from quicknxs.interfaces.data_handling.instrument import mantid_algorithm_exec # 3rd-party imports import mantid.simpleapi as api diff --git a/test/unit/reflectivity_ui/interfaces/data_handling/test_filepath.py b/test/unit/quicknxs/interfaces/data_handling/test_filepath.py similarity index 97% rename from test/unit/reflectivity_ui/interfaces/data_handling/test_filepath.py rename to test/unit/quicknxs/interfaces/data_handling/test_filepath.py index 778aec16..29eb64e5 100644 --- a/test/unit/reflectivity_ui/interfaces/data_handling/test_filepath.py +++ b/test/unit/quicknxs/interfaces/data_handling/test_filepath.py @@ -1,5 +1,5 @@ # local imports -from reflectivity_ui.interfaces.data_handling.filepath import RunNumbers, FilePath +from quicknxs.interfaces.data_handling.filepath import RunNumbers, FilePath # 3rd-party imports import pytest diff --git a/test/unit/reflectivity_ui/interfaces/data_handling/test_gisans.py b/test/unit/quicknxs/interfaces/data_handling/test_gisans.py similarity index 85% rename from test/unit/reflectivity_ui/interfaces/data_handling/test_gisans.py rename to test/unit/quicknxs/interfaces/data_handling/test_gisans.py index 1ef0dca0..ac8bd3c8 100644 --- a/test/unit/reflectivity_ui/interfaces/data_handling/test_gisans.py +++ b/test/unit/quicknxs/interfaces/data_handling/test_gisans.py @@ -1,7 +1,7 @@ # local imports -from reflectivity_ui.interfaces.configuration import Configuration -from reflectivity_ui.interfaces.data_handling.gisans import GISANS -from reflectivity_ui.interfaces.data_manager import DataManager +from quicknxs.interfaces.configuration import Configuration +from quicknxs.interfaces.data_handling.gisans import GISANS +from quicknxs.interfaces.data_manager import DataManager # third-party imports import pytest diff --git a/test/unit/reflectivity_ui/interfaces/data_handling/test_instrument.py b/test/unit/quicknxs/interfaces/data_handling/test_instrument.py similarity index 94% rename from test/unit/reflectivity_ui/interfaces/data_handling/test_instrument.py rename to test/unit/quicknxs/interfaces/data_handling/test_instrument.py index be6a0e16..b7acd394 100644 --- a/test/unit/reflectivity_ui/interfaces/data_handling/test_instrument.py +++ b/test/unit/quicknxs/interfaces/data_handling/test_instrument.py @@ -1,6 +1,6 @@ # package imports -from reflectivity_ui.interfaces.configuration import Configuration -from reflectivity_ui.interfaces.data_handling.instrument import mantid_algorithm_exec +from quicknxs.interfaces.configuration import Configuration +from quicknxs.interfaces.data_handling.instrument import mantid_algorithm_exec # 3rd party imports from mantid.api import MatrixWorkspaceProperty, PythonAlgorithm diff --git a/test/unit/reflectivity_ui/interfaces/data_handling/test_off_specular.py b/test/unit/quicknxs/interfaces/data_handling/test_off_specular.py similarity index 86% rename from test/unit/reflectivity_ui/interfaces/data_handling/test_off_specular.py rename to test/unit/quicknxs/interfaces/data_handling/test_off_specular.py index b40056b2..6ec47a2a 100644 --- a/test/unit/reflectivity_ui/interfaces/data_handling/test_off_specular.py +++ b/test/unit/quicknxs/interfaces/data_handling/test_off_specular.py @@ -1,7 +1,7 @@ # local imports -from reflectivity_ui.interfaces.configuration import Configuration -from reflectivity_ui.interfaces.data_handling.off_specular import OffSpecular -from reflectivity_ui.interfaces.data_manager import DataManager +from quicknxs.interfaces.configuration import Configuration +from quicknxs.interfaces.data_handling.off_specular import OffSpecular +from quicknxs.interfaces.data_manager import DataManager # third-party imports import pytest diff --git a/test/unit/reflectivity_ui/interfaces/data_handling/test_quicknxs_io.py b/test/unit/quicknxs/interfaces/data_handling/test_quicknxs_io.py similarity index 96% rename from test/unit/reflectivity_ui/interfaces/data_handling/test_quicknxs_io.py rename to test/unit/quicknxs/interfaces/data_handling/test_quicknxs_io.py index 694c504f..1e03ef1d 100644 --- a/test/unit/reflectivity_ui/interfaces/data_handling/test_quicknxs_io.py +++ b/test/unit/quicknxs/interfaces/data_handling/test_quicknxs_io.py @@ -1,7 +1,7 @@ # local imports -from reflectivity_ui.interfaces.configuration import Configuration -from reflectivity_ui.interfaces.data_handling.data_set import NexusData, CrossSectionData -from reflectivity_ui.interfaces.data_handling.quicknxs_io import ( +from quicknxs.interfaces.configuration import Configuration +from quicknxs.interfaces.data_handling.data_set import NexusData, CrossSectionData +from quicknxs.interfaces.data_handling.quicknxs_io import ( read_reduced_file, write_reflectivity_header, write_reflectivity_data, diff --git a/test/unit/reflectivity_ui/interfaces/event_handlers/test_main_handler.py b/test/unit/quicknxs/interfaces/event_handlers/test_main_handler.py similarity index 89% rename from test/unit/reflectivity_ui/interfaces/event_handlers/test_main_handler.py rename to test/unit/quicknxs/interfaces/event_handlers/test_main_handler.py index 7fcd45f0..b0872d9b 100644 --- a/test/unit/reflectivity_ui/interfaces/event_handlers/test_main_handler.py +++ b/test/unit/quicknxs/interfaces/event_handlers/test_main_handler.py @@ -2,11 +2,11 @@ import numpy as np from qtpy import QtWidgets, QtCore -from reflectivity_ui.interfaces.configuration import Configuration -from reflectivity_ui.interfaces.data_handling.data_manipulation import NormalizeToUnityQCutoffError -from reflectivity_ui.interfaces.data_handling.data_set import NexusData, CrossSectionData -from reflectivity_ui.interfaces.main_window import MainWindow -from reflectivity_ui.interfaces.event_handlers.main_handler import MainHandler +from quicknxs.interfaces.configuration import Configuration +from quicknxs.interfaces.data_handling.data_manipulation import NormalizeToUnityQCutoffError +from quicknxs.interfaces.data_handling.data_set import NexusData, CrossSectionData +from quicknxs.interfaces.main_window import MainWindow +from quicknxs.interfaces.event_handlers.main_handler import MainHandler # 3rd-party imports from PyQt5.QtWidgets import QApplication @@ -78,10 +78,10 @@ def test_congruency_fail_report(self, data_server): def test_stitch_reflectivity_errors(self, mocker, error_type, error_msg): """Test that stitch_reflectivity catches errors in stitching and calls report_message""" # Mock exception raised in stitch_data_sets - mocker.patch("reflectivity_ui.interfaces.data_manager.DataManager.stitch_data_sets", side_effect=error_type) + mocker.patch("quicknxs.interfaces.data_manager.DataManager.stitch_data_sets", side_effect=error_type) # Mock call to function report_message mock_report_message = mocker.patch( - "reflectivity_ui.interfaces.event_handlers.main_handler.MainHandler.report_message" + "quicknxs.interfaces.event_handlers.main_handler.MainHandler.report_message" ) self.handler.stitch_reflectivity() assert error_msg in mock_report_message.call_args[0][0] @@ -90,21 +90,19 @@ def test_stitch_reflectivity_errors(self, mocker, error_type, error_msg): def test_save_run_data(tmp_path, qtbot, mocker): """Test of method save_run_data""" mocker.patch( - "reflectivity_ui.interfaces.event_handlers.main_handler.QtWidgets.QFileDialog.getExistingDirectory", + "quicknxs.interfaces.event_handlers.main_handler.QtWidgets.QFileDialog.getExistingDirectory", return_value=tmp_path, ) mocker.patch( - "reflectivity_ui.interfaces.event_handlers.main_handler.QtWidgets.QInputDialog.getText", + "quicknxs.interfaces.event_handlers.main_handler.QtWidgets.QInputDialog.getText", return_value=("test_save_run_data", True), ) header = "col1 col2" mocker.patch( - "reflectivity_ui.interfaces.data_handling.data_set.CrossSectionData.get_tof_counts_table", + "quicknxs.interfaces.data_handling.data_set.CrossSectionData.get_tof_counts_table", return_value=(np.ones((5, 5)), header), ) - mocker.patch( - "reflectivity_ui.interfaces.event_handlers.main_handler.MainHandler.ask_question", side_effect=[False, True] - ) + mocker.patch("quicknxs.interfaces.event_handlers.main_handler.MainHandler.ask_question", side_effect=[False, True]) main_window = MainWindow() handler = MainHandler(main_window) diff --git a/test/unit/reflectivity_ui/interfaces/test_configuration.py b/test/unit/quicknxs/interfaces/test_configuration.py similarity index 86% rename from test/unit/reflectivity_ui/interfaces/test_configuration.py rename to test/unit/quicknxs/interfaces/test_configuration.py index 8e49fed6..636f99a4 100644 --- a/test/unit/reflectivity_ui/interfaces/test_configuration.py +++ b/test/unit/quicknxs/interfaces/test_configuration.py @@ -1,4 +1,4 @@ -from reflectivity_ui.interfaces.configuration import Configuration, get_direct_beam_low_res_roi +from quicknxs.interfaces.configuration import Configuration, get_direct_beam_low_res_roi def test_get_direct_beam_low_res_roi(): diff --git a/test/unit/reflectivity_ui/interfaces/test_data_manager.py b/test/unit/quicknxs/interfaces/test_data_manager.py similarity index 94% rename from test/unit/reflectivity_ui/interfaces/test_data_manager.py rename to test/unit/quicknxs/interfaces/test_data_manager.py index 950af32a..f4e216b2 100644 --- a/test/unit/reflectivity_ui/interfaces/test_data_manager.py +++ b/test/unit/quicknxs/interfaces/test_data_manager.py @@ -1,8 +1,8 @@ # local imports -from reflectivity_ui.interfaces.data_manager import DataManager -from reflectivity_ui.interfaces.configuration import Configuration -import reflectivity_ui.interfaces.data_handling.data_manipulation as dm -from reflectivity_ui.interfaces.data_handling.instrument import Instrument +from quicknxs.interfaces.data_manager import DataManager +from quicknxs.interfaces.configuration import Configuration +import quicknxs.interfaces.data_handling.data_manipulation as dm +from quicknxs.interfaces.data_handling.instrument import Instrument # 3rd-party imports import pytest