diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index b7ee0ca0..00000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,26 +0,0 @@ - -## Expected Behavior - - - -## Current Behavior - - - -## Possible Solution - - - -## Steps to Reproduce (for bugs) - - -1. -2. -3. - -## Context - - - -## Your Environment - diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ad36c361..7b48a73b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -25,5 +25,3 @@ - [ ] New/changed functions and methods are covered in the test suite where possible - [ ] Test suite passes locally - [ ] Test suite passes on GitHub Actions -- [ ] Ran ``docs/pre-release-notes.sh`` and created a pre-release documentation page -- [ ] Pre-release docs include context, functional descriptions, and contributors as appropriate diff --git a/.gitignore b/.gitignore index 31847f5c..458bd375 100644 --- a/.gitignore +++ b/.gitignore @@ -121,3 +121,6 @@ hutch_python/tests/tst/db.txt # unit test artifacts *.sqlite + +# setuptools-scm +_version.py diff --git a/docs/pre-release-notes.sh b/docs/pre-release-notes.sh deleted file mode 100755 index 6e1e12b6..00000000 --- a/docs/pre-release-notes.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -ISSUE=$1 -shift -DESCRIPTION=$* - -if [[ -z "$ISSUE" || -z "$DESCRIPTION" ]]; then - echo "Usage: $0 (ISSUE NUMBER) (DESCRIPTION)" - exit 1 -fi - -re_issue_number='^[1-9][0-9]*$' - -if ! [[ "$ISSUE" =~ $re_issue_number ]]; then - echo "Error: Issue number is not a number: $ISSUE" - echo - echo "This should preferably be the issue number that this pull request solves." - echo "We may also accept the Pull Request number in place of the issue." - exit 1 -fi - -echo "Issue: $ISSUE" -echo "Description: $DESCRIPTION" - -FILENAME=source/upcoming_release_notes/${ISSUE}-${DESCRIPTION// /_}.rst - -pushd "$(dirname "$0")" || exit 1 - -sed -e "s/IssueNumber Title/${ISSUE} ${DESCRIPTION}/" \ - "source/upcoming_release_notes/template-short.rst" > "${FILENAME}" - -if ${EDITOR} "${FILENAME}"; then - echo "Adding ${FILENAME} to the git repository..." - git add "${FILENAME}" -fi - -popd || exit 0 diff --git a/docs/release_notes.py b/docs/release_notes.py deleted file mode 100644 index 4b5d0ee7..00000000 --- a/docs/release_notes.py +++ /dev/null @@ -1,114 +0,0 @@ -import sys -import time -from collections import defaultdict -from pathlib import Path - -# find the pre-release directory and release notes file -THIS_DIR = Path(__file__).resolve().parent -PRE_RELEASE = THIS_DIR / 'source' / 'upcoming_release_notes' -TEMPLATE = PRE_RELEASE / 'template-short.rst' -RELEASE_NOTES = THIS_DIR / 'source' / 'releases.rst' - -# Set up underline constants -TITLE_UNDER = '#' -RELEASE_UNDER = '=' -SECTION_UNDER = '-' - - -def parse_pre_release_file(path): - """ - Return dict mapping of release notes section to lines. - - Uses empty list when no info was entered for the section. - """ - print(f'Checking {path} for release notes.') - with path.open('r') as fd: - lines = fd.readlines() - - section_dict = defaultdict(list) - prev = None - section = None - - for line in lines: - if prev is not None: - if line.startswith(SECTION_UNDER * 2): - section = prev.strip() - continue - if section is not None and line[0] in ' -': - notes = section_dict[section] - if len(line) > 6: - notes.append(line) - section_dict[section] = notes - prev = line - - return section_dict - - -def extend_release_notes(path, version, release_notes): - """ - Given dict mapping of section to lines, extend the release notes file. - """ - with path.open('r') as fd: - lines = fd.readlines() - - new_lines = ['\n', '\n'] - date = time.strftime('%Y-%m-%d') - release_title = f'{version} ({date})' - new_lines.append(release_title + '\n') - new_lines.append(len(release_title) * RELEASE_UNDER + '\n') - new_lines.append('\n') - for section, section_lines in release_notes.items(): - if section == 'Contributors': - section_lines = sorted(list(set(section_lines))) - if len(section_lines) > 0: - new_lines.append(section + '\n') - new_lines.append(SECTION_UNDER * len(section) + '\n') - new_lines.extend(section_lines) - new_lines.append('\n') - - output_lines = lines[:2] + new_lines + lines[2:] - - print('Writing out release notes file') - for line in new_lines: - print(line.strip('\n')) - with path.open('w') as fd: - fd.writelines(output_lines) - - -def main(version_number: str): - section_notes = parse_pre_release_file(TEMPLATE) - to_delete = [] - for path in PRE_RELEASE.iterdir(): - if path.name[0] in '1234567890': - to_delete.append(path) - extra_notes = parse_pre_release_file(path) - for section, notes in section_notes.items(): - notes.extend(extra_notes[section]) - section_notes[section] = notes - - extend_release_notes(RELEASE_NOTES, version_number, section_notes) - - print( - "* Wrote release notes. Please perform the following manually:", - file=sys.stderr, - ) - for path in to_delete: - print(f" git rm {path}", file=sys.stderr) - print(f" git add {RELEASE_NOTES}", file=sys.stderr) - - -if __name__ == '__main__': - if len(sys.argv) != 2: - print(f"Usage: {sys.argv[0]} VERSION_NUMBER", file=sys.stderr) - sys.exit(1) - - version_number = sys.argv[1] - - if not version_number.startswith("v"): - print( - f"Version number should start with 'v': {version_number}", - file=sys.stderr - ) - sys.exit(1) - - main(version_number) diff --git a/docs/source/releases.rst b/docs/source/releases.rst index f71ef186..6ad72787 100644 --- a/docs/source/releases.rst +++ b/docs/source/releases.rst @@ -1,801 +1,4 @@ Release History ############### - -v1.23.1 (2025-05-14) -==================== - -Bugfixes --------- -- Fixed pathcheck in hutch_python/epics_arch.py:create_softlink - -Maintenance ------------ -- Separate test_hist_file_arg into three separate test cases to hopefully alleviate test suite timeout issues - -Contributors ------------- -- tangkong -- vespos - - - -v1.23.0 (2025-04-07) -==================== - -Features --------- -- Added ability to load additional devices not on the current beamline or hutch/area using happi search. - -Bugfixes --------- -- update functions anticipating py3.12 and IPython > 8.26 - -Maintenance ------------ -- Enable the deferral of preset loading to avoid a pre-mature performance hit - -Contributors ------------- -- janeliu-slac -- tangkong - - - -v1.22.0 (2024-12-19) -==================== - -Features --------- -- Add ``pcdscalc.xray`` to the calc namespace. -- Add top-level shortcuts to some of the most used calcs, - ``E2lam``, ``lam2E``, ``bragg_angle``, ``darwin_width``, - and ``transmission``. - ``E2lam`` is an alias for ``energy_to_wavelength`` and - ``lam2E`` is an alias for ``wavelength_to_energy`` - to match scientist expectations. -- Added ability to ignore specific upstream devices when loading hutch-python. - - - ``UPSTREAM``: The hutch's devices, and devices upstream from the requested hutch. - If there are multiple paths to the requested hutch, all paths devices are loaded. - - ``STANDARD``: Devices gathered via ``UPSTREAM``, plus devices that share the - "beamline" field in happi with the ``UPSTREAM`` devices. (The current standard) - - ``ALL``: All devices in the happi database. Use this option at your own risk. - - -Bugfixes --------- -- Make test_create_arg agnostic to where pytest was invoked from -- Fix an issue where the user could clobber their own ``elog`` - object in a way that would allow the ``ElogPoster`` utility to - load and then fail at scan time. - -Maintenance ------------ -- Updates documentation formatting for device load_level, and adds an ascii beamline map to the test suite - -Contributors ------------- -- janeliu-slac -- tangkong -- vespos -- zllentz - - - -v1.21.0 (2024-08-20) -==================== - -Features --------- -- Automatically timeout and closes hutch-python sessions after the user has been - idle for a certain number of hours. The number of hours can be set in conf.yml - for each hutch. If no value is set the default timeout duration is 48 hours. - -Maintenance ------------ -- Document some first-pass efforts at running hutch-python in jupyter notebooks. -- Fix an issue where an upstream numpy 2 incompatibilty was breaking the pypi builds. - -Contributors ------------- -- janeliu-slac -- zllentz - - - -v1.20.0 (2024-04-19) -==================== - -Features --------- -- Allow per-session separate ipython histories via ``--hist-file`` - command-line argument. If omitted, default ipython behavior is used. - When ``--hist-file`` is included with no argument, the history file - will be written a local operator console hard drive, if available. - An argument can be provided to use any file as the history.sqlite file. - -Contributors ------------- -- zllentz - - - -v1.19.0 (2024-04-15) -==================== - -Features --------- -- Updates EpicsArch script, adding several debug/testin flags and ensuring - information is up-to-date. Includes: - - - ``update_file``: feature that updates EpicsArch based on current questionnaire - - ``--softlink``: point arch file to new experiment via symbolic link - - ``--level``: specify a debug level - - ``--cds-items``: displays questionnaire data for a given run and experiment - - ``--link-path``: allows user to provide custom filepath for softlinks -- Adds load_level conf.yaml key for choosing the method used to gather happi devices - -Contributors ------------- -- c-tsoi -- tangkong - - - -v1.18.5 (2023-09-14) -==================== - -Maintenance ------------ -- Strips whitespace from PVs gathered during cam_load routine. - -Contributors ------------- -- tangkong - - -v1.18.4 (2023-07-26) -==================== - -Maintenance ------------ -- Unpin strict pyqt pin, we now just require pyqt5 of any flavor. -- Fix a bug where non-conda installs and non-standard conda installs - (like mambabuild intermediates) would be unable to use the - `hutch-python --create` cookiecutter tool. -- Add send and recv methods to the fake zmq socket because newer - versions of the lcls2 daq code are expecting recv. -- Fix pyproject.toml typo docs -> doc. -- Update requirements.txt for accuracy now that - psdaq-control-minimal is available on pypi. -- Include docs-versions-menu for the sphinx docs builds. - - -Contributors ------------- -- klauer -- zllentz - - -v1.18.3 (2023-04-11) -==================== - -Maintenance ------------ -- Set the package name back to hutch-python for conda builds - for consistency's sake. - -Contributors ------------- -- klauer -- zllentz - - -v1.18.2 (2023-04-11) -==================== - -Maintenance ------------ -- Fix an issue where the test suite would not run with the latest - lightpath. This was a test-suite only bug, not a runtime - function bug. -- Fix an issue where pypi/conda upload builds would not have - proper authentication. - -Contributors ------------- -- zllentz - - -v1.18.1 (2023-04-04) -==================== - -Bugfixes --------- -- Fix an edge case where all hutch devices may be skipped in the load - if all of them are missing from lightpath. - -Maintenance ------------ -- hutch-python no longer uses Travis CI and has migrated to GitHub Actions for - continuous integration, testing, and documentation deployment. -- hutch-python has been migrated to use setuptools-scm, replacing versioneer, as its - version-string management tool of choice. -- hutch-python has been migrated to use the modern ``pyproject.toml``, replacing - ``setup.py`` and related files. -- Older language features and syntax found in the repository have been updated - to Python 3.9+ standards by way of ``pyupgrade``. -- Sphinx 6.0 is now supported for documentation building. - ``docs-versions-menu`` replaces ``doctr-versions-menu`` and ``doctr`` usage - for documentation deployment on GitHub Actions. The deployment key is now no - longer required. -- pyupgrade was used to update annotations, and pycln was used to clean up - imports. - -Contributors ------------- -- klauer -- zllentz - - - -v1.18.0 (2022-10-25) -==================== - -Features --------- -- Updates database loading to utilize updated lightpath (v1.0.0) - for loading devices. This makes the newer, reworked version of - lightpath available in the session instead of the old version. - -Maintenance ------------ -- Fix issues with running tests offline on LCLS servers. - -Contributors ------------- -- tangkong -- zllentz - - -v1.17.0 (2022-07-27) -==================== - -Features --------- -- In the facility logger, show the source of the exception in the facility - log message summary. This will make it easier to understand the cause of - uncaught exceptions that get sent to the facility logger. - - -v1.16.0 (2022-06-03) -==================== - -Features --------- -- Add the ``obj_config`` key to the ``conf.yml`` configuration file. - This allows the user to pass in the path to a file that contains - object reconfiguration information. - Currently, tab completion whitelists/blacklists and ``ophyd`` - component ``kind`` configuration are supported. -- Switch the best effort callback instance ``bec`` to use the - ``BECOptionsPerRun`` callback from ``nabs`` instead of the previous - ``BestEffortCallback`` from ``bluesky``. - This new class is a subclass of ``BestEffortCallback`` that allows - us to configure its options on a per-scan basis by setting metadata keys. - This means we can do things like disabling plots on scans where it - makes no sense, and perhaps more features in the future. - -Contributors ------------- -- tangkong - - -v1.15.0 (2022-05-02) -==================== - -Features --------- -- Add automatic ELOG post configuration to the run engine. -- Add a much more helpful startup banner that calls out specific - helpful objects in the namespace. - -Fixes ------ -- Make the dev package identifier very robust. - -Maintenance ------------ -- Configure and satisfy pre-commit checks. -- Rework and clean up the post-IPython initialization. - -Contributors ------------- -- tangkong - - -v1.14.0 (2022-03-31) -==================== - -Features --------- -- Ctrl+C now aborts the current run, returning the RunEngine to a - ready / idle state. The old pause functionality has been moved to - Ctrl+\\. -- Include per-device load times for devices loaded from happi. -- Load a run-engine wrapped namespace (lowercase ``re``) as a replacement - for the proliferation of roll-your-own wrappers, and also add wrapped - daq scan functions to the ``daq`` object. -- Add plan wrappers to all plans to make it clear which are plans and - which are functions. -- Show the environment information at startup so the user knows what - version of the software they are running. - -Contributors ------------- -- klauer -- tangkong -- zllentz - - -v1.13.2 (2022-02-11) -==================== - -Fixes and Maintenance ---------------------- -Configure ``IPython`` to disable ``black`` input reformatting, -for three reasons: - - 1. Throws errors in our terminal after the first input - 2. Conflicts with advice in the ``black`` github issues that assert that - ``black`` is not ready to be used as an import. - 3. I don't think it's a good fit for the scientific computing and expect - that it will be annoying in practice. - -Contributors ------------- -- zllentz - - -v1.13.1 (2022-02-07) -==================== - -Fixes and Maintenance ---------------------- -- Noisy logger detection is now configured but disabled by default. -- Noisy logger detection is split between the file and the console. -- Allow both QtAgg and Qt5Agg as valid matplolib backends for the loaded - environment. -- Include ``daq_type`` and ``daq_host`` in the list of valid keys for the - purpose of warning the user about a malformed config. These have been - valid, but produce an incorrect warning. -- Expand the default LCLS2 DAQ timeout from 1 second to 10 seconds to fix - an issue where we would time out on expected long operations. - -Contributors ------------- -- klauer -- zllentz - - -v1.13.0 (2021-11-10) -==================== - -Features --------- -- Noisy loggers will automatically be filtered based on message rate metrics - as to not disturb the user. -- Warnings will be redirected to the logging stream, making them show up - in the log files. -- Warnings will only be shown once each per session per warning source, - rather than after every IPython line, via demoting them to DEBUG level - in the console, as to not disturb the user. -- Callback exception log messages will be demoted to DEBUG level in the - console as to not disturb the user. - -Fixes and Maintenance ---------------------- -- Add documentation about the log namespace. -- Fix an issue where certain helpful namespaces inside of helpful namespaces - in specific situations would not render properly. -- Fix various issues with the CI and move it to Python 3.9 only. -- Remove no longer needed inflection dependency - - -v1.12.0 (2021-09-28) -==================== - -Features --------- -- Add functionality for specifying parameters for and automatically - instantiating the LCLS2 DAQ object (BlueskyScan) via an optional - psdaq.control dependency and configuration keys. - -Fixes and Maintenance ---------------------- -- Restore the CI pypi build to running. -- Properly setup lightpath, psdm_qs_cli, and elog as optional dependencies. -- Clean up the documentation about the configuration file. - - -v1.11.2 (2021-08-09) -==================== - -Fixes and Maintenance ---------------------- -- Fix order of message logging in the IPython input logger. Previously, the - In log message wouldn't happen until after the command had already finished. - Now, the In message is logged, then any normal log messages are logged, and - then finally the Out message is logged, all neatly in order. -- Adjust exception handling output for log files and for centralized logger. -- Log exceptions in threads -- Only log to the centralized PCDS logger when on a PCDS host -- Support stacklevel for centralized logging on Python 3.8+ -- Make elog and lightpath optional dependencies for pip - - -v1.11.1 (2021-07-09) -==================== - -Fixes and Maintenance ---------------------- -- Fix issues related to matplotlib setup in headless mode. This means that it - will no longer crash the session when used without x-forwarding. - - -v1.11.0 (2021-06-04) -==================== - -Features --------- -- Added ability to opt-in to specific Ophyd Object instance DEBUG logs. Call - ``logs.log_objects(obj1, obj2)`` to configure it for ``obj1`` and ``obj2``, - for example, and clear it by way of ``logs.log_objects_off()``. -- Added a new ``logs`` object in the IPython namespace, offering easy access - to common log-related tools. - - -Fixes and Maintenance ---------------------- -- Refactored logging setup to be more modular and slightly better documented. - The ophyd logger is no longer "hushed", but is now filtered through the - new ``ObjectFilter`` mechanism. - - -v1.10.1 (2021-06-03) -==================== - -Bugfixes --------- -- Fix an issue where ophyd signals were configured to wait "forever" for their - write timeouts. By default, this is now a 5 second timeout instead of no - timeout. This unfortunate default resulted in some cases where PVs would - get "stuck" in a "set_and_wait" that would never end. In ophyd, this default - is intentionally left to infinite to satisfy the common case where signals - don't update to the final value for a long period of time. - These cases are very uncommon at the LCLS. - - -v1.10.0 (2021-04-15) -==================== - -Features --------- -- ``IterableNamespace`` has been upgraded to be ``HelpfulNamespace``, while - maintaining a backward-compatible import name. This class supports the - IPython "pretty repr" and HTML repr hooks to provide user-friendly tables of - items available in the namespace, as well as direct keyword-access to - elements of the namespace. -- All objects loaded in load_conf have been annotated with what they are used - for in the Python session. These annotations are available when viewing - the ``HelpfulNamespace`` pretty and HTML reprs. - -Bugfixes --------- -- Fix an issue where the get_current_hutch scripts were using a deprecated and - removed argument structure. - - -v1.9.1 (2021-02-10) -=================== - -Bugfixes --------- -- Display small values in scientific notation during scans, rather than as - 0.000000. Similarly handle very large values. -- Include the BestEffortCallback that we are using in the hutch's namespace - for easy access. - - -v1.9.0 (2020-12-22) -=================== - -Features --------- -- Add ``epicsarch-qs`` script that will handle creating ``epicsArch`` files - from the LCLS questionnaire. -- Include plans from ``nabs`` in the default namespaces. -- Include calcs from ``pcdsdevices`` in the default namespaces. - -Bugfixes --------- -- Fix issue where tab completion filters would not work due to ``IPython`` - quirks in cases where ``jedi`` is disabled. -- Fix issue where devices with negative z would not load from ``happi``. - -Maintenance ------------ -- Update the hutch environment templates. - - -v1.8.0 (2020-10-23) -=================== - -Features --------- -- Include the beam_stats and lcls objects in every hutch python session. -- Enable scan PVs for all consumers (instead of starting as disabled). - -Bugfixes --------- -- Fix load order so that beamline and experiment files happen as late as possible. - - -v1.7.0 (2020-10-21) -=================== - -Features --------- -- Alert and show the user the full traceback when there are issues loading - user files like beamline and experiment files. -- Ask the user if it is okay to proceed with the user file loading failure, - which typically renders the session useless, rather than just - passing over the issue. - - -v1.6.1 (2020-10-07) -=================== - -Fixes and Maintenance ---------------------- -- Re-tag of v1.6.0 to trigger the anaconda upload. - - -v1.6.0 (2020-10-07) -=================== - -Features --------- -- Expand motors group to have all positioners. -- Add detectors (d) namespace for ami detectors. -- Time safe_load and report duration. -- Add a few simulated motors by default in a sim namespace. - - -Fixes and Maintenance ---------------------- -- Pass hutch name to daq to avoid calling get_hutch_name, which can be slow. -- Disable tree namespace until issues are resolved. - - -v1.5.1 (2020-10-02) -=================== - -Fixes and Maintenance ---------------------- -- Remove jedi tab completion again, again. - - -v1.5.0 (2020-09-18) -=================== - -Features --------- -- Send uncaught exceptions to the centrally configured logstash - -Fixes and Maintenance ---------------------- -- Fix issues related to LivePlot segmentation faults -- Remove jedi tab completion, again -- Fix and standardize the CI configuration - - -v1.4.0 (2020-08-18) -=================== - -Features --------- -- Load hutch-python with engineering mode disabled to optimize interactive - use. - -Fixes and Maintenance ---------------------- -- Fix bad log message handler in test suite - - -v1.3.1 (2020-07-27) -=================== - -Fixes and Maintenance ---------------------- -- Test suite update for compatibility with lightpath v0.6.5 - - -v1.3.0 (2020-07-01) -=================== - -Features --------- -- Pack camviewer config into a camviewer namespace for ease of access - and to avoid name collisions with other data sources. - - -v1.2.3 (2020-05-29) -=================== - -Fixes and Maintenance ---------------------- -- Fix issue with tests freezing - - -v1.2.2 (2020-05-21) -=================== - -Fixes and Maintenance ---------------------- -- Fix issue with generated area detectors having the wrong prefix - - -v1.2.1 (2020-05-21) -=================== - -Fixes and Maintenance ---------------------- -- Fix issue preventing conda upload on tag - - -v1.2.0 (2020-05-21) -=================== - -Features --------- -- Configure the logstash logger using ``pcdsutils`` - -Fixes and Maintenance ---------------------- -- Adjust for latest ``happi`` API -- Add documentation about logstash logging -- Hush the noisiest loggers that are spamming the terminal sessions - - -v1.1.1 (2020-02-05) -=================== - -Fixes and Maintenance ---------------------- -- Make tests compatible with ``ophyd`` ``v1.1.1`` -- Small adjustments to remove some warnings -- Small updates to hutch directory generator - -v1.1.0 (2020-01-10) -=================== - -Features --------- -- Add ``archapp`` support. Check out the ``archive`` object in the hutch - python namespace for access to the archiver appliance data. - -v1.0.1 (2019-03-08) -=================== - -Fixes and Maintenance ---------------------- -- Clean up code for the ``hutch-python`` launcher -- Fix issues with the test suite -- Fix issues with automatically loading ipython profiles - -v1.0.0 (2018-10-12) -=================== - -API Breaks ----------- -- Swap to the newer ``psdm_qs_cli`` API for experiment loading that is - compatible with commissioning experiment names. - -v0.7.0 (2018-08-06) -=================== - -Features --------- -- Add a ``ScanVars`` class for the legacy scan pvs tie-in. -- Automatically load all cameras defined in the camviewer config file. -- Add the ``--exp`` arg for forcing the active experiment for the duration - of a session. - -Bugfixes --------- -- Exclude having a beampath when there are no devices on the path. - This is because the resulting empty path causes issues in the - environment. This will most commonly occur when calling - ``hutch-python`` with no arguments. - -Misc ----- -- Fix a few typos - -v0.6.0 (2018-05-27) -=================== - -Features --------- -- Provide well-curated namespaces for ``bluesky`` plans. These are in the - shell as ``bp`` (bluesky plans) for normal plans, ``bps`` (bluesky plan - stubs) for plans that are not complete on their own, and ``bpp`` - (bluesky plan preprocessors) for plans that modify other plans. - -Bugfixes ---------- -- Show a correct error message when there is an ``ImportError`` in an - experiment file. This previously assumed the ``ImportError`` was from - a missing experiment file. (#126) -- Prevent duplicate names in `tree_namespace` from breaking the tree. - Show a relevant warning message. (#128) -- Do not configure the ``matplotlib`` backend for IPython if a user does not - have a valid ``$DISPLAY`` environment variable. The most common case of this - is if X-Forwarding is disabled. (#132) - -v0.5.0 (2018-05-08) -=================== - -Bugfixes ---------- -- fix issue where importing hutchname.db could break under certain conditions -- fix issue where autocompleting a ``SimpleNamespace`` subclass would always - have an extra mro() method, even though this is a class method not shared - with instances. -- add logs folder to the hutch-python directory creator - -API Changes ------------ -- ``metadata_namespace`` renamed to `tree_namespace` - -v0.4.0 (2018-04-23) -=================== - -Features --------- -- ``elog`` object and posting -- load devices upstream from the hutch along the light path - -Bugfixes --------- -- Allow posting bug reports to github from the control room machines through the proxy -- Optimize the namespaces for faster loads and avoid a critical slowdown bug -- Make hutch banner as early as possible to avoid errant log messages in front of the banner -- Make cxi's banner red, as was intended -- hutch template automatically picks the latest environment, instead of hard-coding it - -v0.3.0 (2018-04-06) -=================== - -Features --------- -- In-terminal bug reporting -- Port of the old python presets system -- Objects from the questionnaire are included in the experiment object -- Experiment object is always included - -Bugfixes --------- -- No longer create 1-item metadata objects -- ``db.txt`` is created in all-write mode - -API Changes ------------ -- Daq platform map is no longer stored in the module, this now must be configured - through ``conf.yml`` for nonzero platforms. - -Minor Changes -------------- -- ``qs.cfg`` renamed to ``web.cfg``, with backwards compatibility +See the `releases page on GitHub `_ diff --git a/docs/source/upcoming_release_notes/403-mnt_dep_pkg_resources.rst b/docs/source/upcoming_release_notes/403-mnt_dep_pkg_resources.rst deleted file mode 100644 index 4b2883f4..00000000 --- a/docs/source/upcoming_release_notes/403-mnt_dep_pkg_resources.rst +++ /dev/null @@ -1,22 +0,0 @@ -403 mnt_dep_pkg_resources -######################### - -API Changes ------------ -- N/A - -Features --------- -- N/A - -Bugfixes --------- -- N/A - -Maintenance ------------ -- replace deprecated pkg_resources.working_set with importlib.metadata.distributions - -Contributors ------------- -- tangkong diff --git a/docs/source/upcoming_release_notes/404-mnt_enable_jedi.rst b/docs/source/upcoming_release_notes/404-mnt_enable_jedi.rst deleted file mode 100644 index f7a6eaa6..00000000 --- a/docs/source/upcoming_release_notes/404-mnt_enable_jedi.rst +++ /dev/null @@ -1,23 +0,0 @@ -404 mnt_enable_jedi -################### - -API Changes ------------ -- N/A - -Features --------- -- N/A - -Bugfixes --------- -- Work around an issue where non-jedi completions were broken for pcdsdevices - in certain IPython ranges by re-enabling jedi completions in those ranges. - -Maintenance ------------ -- N/A - -Contributors ------------- -- zllentz diff --git a/docs/source/upcoming_release_notes/template-full.rst b/docs/source/upcoming_release_notes/template-full.rst deleted file mode 100644 index 9f86b87e..00000000 --- a/docs/source/upcoming_release_notes/template-full.rst +++ /dev/null @@ -1,36 +0,0 @@ -IssueNumber Title -################# - -Update the title above with your issue number and a 1-2 word title. -Your filename should be issuenumber-title.rst, substituting appropriately. - -Make sure to fill out any section that represents changes you have made, -or replace the default bullet point with N/A. - -API Changes ------------ -- List backwards-incompatible changes here. - Changes to PVs don't count as API changes for this library, - but changing method and component names or changing default behavior does. - -Features --------- -- List new updates that add utility to many classes, - provide a new base classes, add options to helper methods, etc. - -Bugfixes --------- -- List bug fixes that are not covered in the above sections. - -Maintenance ------------ -- List anything else. The intent is to accumulate changes - that the average user does not need to worry about. - -Contributors ------------- -- List your github username and anyone else who made significant - code or conceptual contributions to the PR. You don't need to - add reviewers unless their suggestions lead to large rewrites. - These will be used in the release notes to give credit and to - notify you when your code is being tagged. diff --git a/docs/source/upcoming_release_notes/template-short.rst b/docs/source/upcoming_release_notes/template-short.rst deleted file mode 100644 index 5e544ecf..00000000 --- a/docs/source/upcoming_release_notes/template-short.rst +++ /dev/null @@ -1,22 +0,0 @@ -IssueNumber Title -################# - -API Changes ------------ -- N/A - -Features --------- -- N/A - -Bugfixes --------- -- N/A - -Maintenance ------------ -- N/A - -Contributors ------------- -- N/A diff --git a/hutch_python/cam_load.py b/hutch_python/cam_load.py index 8eeeaf8c..37a0a0e0 100644 --- a/hutch_python/cam_load.py +++ b/hutch_python/cam_load.py @@ -123,7 +123,11 @@ def load_cams(info): """ # Any cam that needs the event loop has to have one set in the thread global main_thread_loop - main_thread_loop = asyncio.get_event_loop() + try: + main_thread_loop = asyncio.get_event_loop() + except RuntimeError: + # No loop, no worries + main_thread_loop = None objs = {} logger.debug(info) @@ -150,7 +154,8 @@ def build_and_log(info_part): The loaded detector, or None. """ # We sync with the main thread's loop so that they work as expected later - asyncio.set_event_loop(main_thread_loop) + if main_thread_loop is not None: + asyncio.set_event_loop(main_thread_loop) try: obj = build_cam(*info_part) logger.success('Loaded %s', obj.name) diff --git a/hutch_python/tests/test_cli.py b/hutch_python/tests/test_cli.py index 8bb70737..fdd1535d 100644 --- a/hutch_python/tests/test_cli.py +++ b/hutch_python/tests/test_cli.py @@ -116,7 +116,7 @@ def test_hist_file_arg(): @pytest.mark.timeout(30) -@pytest.mark.parametrize("filepath,", ( +@pytest.mark.parametrize("filepath", ( (CFG_PATH.parent / "aesefiudh" / "history.sqlite").resolve(), ":memory:", )) diff --git a/requirements.txt b/requirements.txt index bc541a37..047f943f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ bluesky>=1.8.0 coloredlogs>=15.0.0 cookiecutter>=1.7.0 happi>=1.9.0 -ipython<9.0.0 +ipython>=9.0.0 jinja2>=2.11.0 lightpath>=1.0.1 matplotlib>=3.4.0