Adds a hook in
happi.loader.from_containerthat runs the method
post_happi_mdon an instantiated object after the metadata container has been attached. This allows a clear method for objects to interact with happi metadata if desired.
HappiDeviceTreeViewmore tolerant of items with missing metadata keys. Items missing the key used to group the tree view will be organized into a catch-all “[KEY NOT FOUND]” group.
happi repaircommand, for synchronizing backend database with fields expected by container. Adds a corresponding audit function.
Adds audit functions that check the connection status of all signals in an ophyd device (
check_wait_connection) and verify any fields requested by args/kwargs exist in the database (
happi audit -d/--detailsoption to print the source of a requested audit function.
happi deleteCLI tool for deleting entries from the happi database.
Fix an issue where an ill-timed interrupt of the json backend’s
storeoperation could truncate the data file. This also removes the implicit/optional dependency on
Migrates from Travis CI to GitHub Actions for continuous integration testing, and documentation deployment.
Updates happi to use setuptools-scm, replacing versioneer, as its version-string management tool of choice.
Syntax has been updated to Python 3.9+ via
happi has migrated to modern
Sphinx 6.0 now supported for documentation building.
- Removed deprecated methods:
include_default_as_kwarg. If set to
False, any keys that are included in an item’s
kwargsthat match the default of their corresponding
EntryInfowill be omitted from the keyword arguments passed to
device_classwhen instantiating (loading) the item as in
SearchResult.get(). If the
include_default_as_kwarg = True, the setting on the corresponding
EntryInfowill be used to decide whether or not to omit a keyword argument. If the
include_default_as_kwarg = False, the setting on corresponding
EntryInfowill be ignored. The default value is True on all EntryInfo instances, retaining the original behavior.
For happi load, fall back to Python REPL if IPython is not available.
Added MultiBackend, which allows a happi Client to serve information from multiple databases simultaneously. Updates config parsing logic to match.
happi auditfunction for running checks on happi database items.
Restored –json option for
Removed extraneous extraneous print in
Calculate a max width for shown tables based on the current terminal size to prevent bad line wrapping.
Prevent ophyd / pyepics teardown during test suite.
Improved error logging in happi CLI to be more consistent.
happi.SearchResult.deviceand above deprecated items are now scheduled for removal in the next major happi release.
Internal backend API
all_deviceshas been changed to
happi.Client.retain_cache_contextfor clients that desire to control when reloading the database from a happi backend happens.
Backend implementations may now optionally support a caching mechanism with
clear_cachebeing called externally by the client when desirable.
The happi container registry now supports adding new container classes manually by way of
happi.containers.registry["ContainerName"] = ContainerClass.
Significant performance increase for JSON-backed happi clients.
SearchResultin happi search cli command
JSON database paths may now be relative to the configuration file.
happi benchmarkfor identifying which items are slow to load.
happi profilefor identifying why particular items are slow to load.
Fix a rare race condition related to reading a json device database twice in a command line search command between database updates.
Issue where happi Client would repeatedly (and unnecessarily) make database backend calls has been fixed.
Allow int search values to match their float counterparts
The happi container registry is loaded at first use and not on import. This can result in increased performance where the happi database is not used. It also fixes a scenario in which a module that defines a happi container attempts to import certain classes from happi.
Old terminology for
HappiIteminstances has been scrubbed and clarified in documentation.
Test suite and documentation has been updated to reflect trajectory of deprecated methods and naming.
Added relaxed flake8 configuration.
Remove happi.device.Device from tests to avoid deprecation warnings
Add type annotations to test suite
Clean up fixture usage and separate
add pre-release notes scripts
More documentation about the happi container registry was added.
Refactored CLI slightly to re-use searching logic.
EntryInfo. This lets us explain what the entry info represents and how it is meant to be filled out in more explicit words when it would be helpful to do.
Added methods to client and cli entry points for changing the container of a happi item. This will walk the user through the process of switching to or between custom containers while making sure we adhere to the defined
EntryInfo. Check out
happi transfer --helpfor command-line usage or
Client.change_containerfor library usage.
Added the option to pick between glob and regex searching from the CLI, rather than only allowing glob as in the past. Give
happi search --regexa try and check out
happi search --helpfor more information.
Fixed an issue where it was previously impossible to input dictionary and list fields using the CLI.
Fixed handling of numeric values in
Fixed range searching logic for multiple range searches in one query.
Fixed the ambiguity between a search returning no results (exit code 0) and a search being malformed (exit code 1).
Refactored the CLI to use
clickinstead of bare
argparse. This implementation is much cleaner and will lead to more advanced CLI features in the future.
pymongoare no longer required dependencies of
happi. These have been reclassified into the
run_constrainedportion of the conda recipe bundled in this repository and will also be adjusted on conda-forge.
Improved usage and cleanup of temporary files when running the happi test suite.
Restored the automatic documention uploads.
Added/modified test cases to better cover search behavior.
Add optional per-device load timers to help identify slow-loading devices.
Fixed an issue where missing keys could cause a find match to fail.
Switch on-import fcntl warning to debug to reduce spam.
--namesflag to the
happi searchcommand. This causes the search to output only the names of the matching devices. This is useful for using the output of
happi searchinside another
happicommand, for example:
happi load $(happi search "*" --names).
Fix a logging format error in
happi container-registrycommand-line utility. This shows the user which
happicontainers are registered and available in their session. This is very useful for debugging purposes and more generally to understand which containers are available.
Fix error in the docs build.
Misc updates to the CI.
happi update <json>command-line utility. This allows the user to pipe in a json blob to the happi CLI to update their database. This enables bulk updates in a convenient way.
Allow short (under 3) and long (over 80) character names. Users who want further restrictions on names for their projects are encouraged to create a custom container.
Allow arbitrary user functions to be passed in to the EntryInfo
enforcefield, for custom validation of data. These functions should mimic the signature and behavior of the built-in types: take one argument, return the value back as-is or cast to the type, raise ValueError if there is an issue.
Properly expand home directory (~) in the JSON backend database path.
Require that the name field does not conflict with reserved Python keywords.
Fix an issue where boolean fields edited from the command-line were always interpreted as True.
Update CI to PCDS standards.
Fix an issue where a package implementing a happi containers entrypoint could fail to be picked up by the happi registry based on the import order.
Revisions, clarifications, and additions to the documentation.
Docstring style fixes.
Fix loading of acromag io channels from the lcls questionnaire. Previously, these were loading full acromag devices instead of individual channels and were using the incorrect PVs.
Fix loading of Beckhoff axis motors from the lcls questionnaire. Previously, these were misidentified as IMS motors.
Refactor questionnaire entry creation to accomplish the above.
Removed hanging raise command from qs loader (hotfix)
Fix various issues causing questionnaire loads to fail.
Fix clarity issues for failed questionnaire loads.
Break up the questionnaire loading routines into more maintainable chunks, reorganizing and cleaning up the code.
Allow introspection of questionnaire state for debugging.
Adds bash/fzf-based fuzzy finding of happi items with corresponding activate/deactivate scripts.
happi search --jsonoption to output JSON instead of a table.
Move IPython import to where it’s needed in
happi load, saving approximately half a second on any other
Fix issue with edge cases in lcls questionnaire loader
Fix issue with unclear warnings on creating malformed entries
Improve testing coverage for CLI functions
Fix cli issue where the
--cloneargument would fail.
Make sure the happi cli returns usage information if the user passes no arguments.
Add cli search globbing, e.g. now the following will work:
happi search xpp*(show all devices whose names start with xpp)
Fix issue with silent failure when editing a non-existent field.
Fix issues related to changing an entry’s name field.
Add documentation for the happi cli
Update the db.json examples to use OphydItem
Do not raise an exception on single malformed entries uncovered during a search. Treat these as missing entries. This was causing an issue where queries like
all_deviceswould fail outright.
Fix issue where
device_clsstring would leak through and raise a bad/confusing exception during
Reduce missing backends log messages from
Fix docs failing to build and related issues.
LCLS-specific containers are moved out of happi, and into pcdsdevices
OphydItemis now the preferred “basic”
ophyd.Devicecontainer, with the intention of fully deprecating
Deviceto avoid naming confusion
Minor internal fixes
Refactor search methods, supporting mongo and JSON backends
search- search by key/value pairs as kwargs
search_range- search for a range of values in a specific key
search_regex- search for key/value pairs as kwargs, with values being regular expressions
SearchResultcontainer, allowing for access of metadata or device instantiation
happi.Deviceis now marked as deprecated
Documentation building fixed and made more accurate
Reduce usage of metaclasses
pymongo/mongomock are truly optional test dependencies now
Added pre-commit configuration for developer quality-of-life
HappiItems are now
Backends supply generators and not lists
Fixed many oustanding issues with the JSON backend
Add an add command for cli, e.g. happi add to start an interactive device adder
Add an edit command for cli, e.g. happi edit im3l0 location=750 prefix=IM3L0:PPM
Change search command syntax to be simpler (more like edit)
Add a load command for cli, e.g. happi load im3l0 im1l1 -> IPython session plus other changes made in dev to “get it working”
Add two new Happi-aware Qt widgets: HappiDeviceListView & HappiDeviceTreeView
Initialize database if it does not yet exists
Fix broken tests
Command line script allow users to search and add devices #84
Containerobject now available with minimum amount of
Allow Happi to load more devices from LCLS questionnaire #94
happi.Clientto allow user to know what beamlines, prefixes, names, etc. will return results.
load_deviceswith option to specify a callback when devices are ready #67
Clientnow has a method
load_devicefor searching the database for a
Containerand then loading the corresponding object based on
kwargs. This is a shortcut to combine two previously existing features
Client.from_configwill create a
Clientobject from a provided configuration file. You can either pass this file in explicitly, specify it via the the environment variable
$HAPPI_CFG, or it will be searched for in
~configor wherever you specify your `$XDG_CONFIG_HOME environment variable
Additional keywords were added to the base
There is now a base container for a
screenis longer a supported key. This was too generic and the three keys detailed above allow the user more specificity.
JSONBackendno longer relies on
fcntla Linux only module of the Python standard library.
from_container, the provided container is compared against the cached version of the device to find discrepancies. This means that modified container objects will always load a new Device. (#62)
The QSBackend uses newer methods available in the psdm_qs_cli to determine the proposal from the experiment name. This is more robust against exotic experiment naming schemas than prior implementations (#68)
QSBackendguesses which a type of motor based on the
prefix. Currently this supports
PMC100motors. While there is not an explicit dependency, this will require
pcdsdevices >= 0.5.0to load properly (#51)
Ownership of this repository has been transferred to https://github.com/pcdshub
Happi now has a cache so the repeated requests to load the same device do not spawn multiple objects.
Cleaner logging messages
QSBackendwas expanded to accommodate different keyword arguments associated with different authentication methods.
happinow handles loading devices with the built-in
EntryInfo-> args, kwargs and device_class. Simply enter the proper information in these fields, either directly inputting information or using
jinja2templating. The functions
load_deviceswill then handle the necessary imports and initialize devices for you
Select which backend you want to use with the environment variable
Backend to read from the PCDS Questionnaire
All containers work out of the box with
pcdsdevices >= 0.3.0## API
All backends are stored in the
The default plugin is now considered to be
The function formerly called
jinja2is now a dependency
psdm_qs_cliis now an optional dependency if you want to use the Questionnaire backend
pymongois now an optional dependency if you do not want to use the MongoDB backend
Only tested against Python
Sent to the
pcds-devAnaconda channels instead of the
happinow supports multiple backends. The required database operations are templated in the
happi.backends.BackendThe existing mongoDB support was kept as the default, but the an additional JSON backend was added. The choice of database type can be entered as an argument to the
Conda builds of
happiare now available at
Devices comparison now works properly. The listed prefix and names are compared.
Mirrorcontainer has been changed to the more specific name
happiwill no longer support Python 2.7
Removed dependency on mongomock in conda-recipe
Renamed alias -> name, and base -> prefix for Ophyd compatibility
Added Python 2.7 support
Added macros keyword for EDM support
Added CI tools for Travis, Codecov
Changed tests to use a
mongomock.MockClientinstead of an actual mongoDB instance
Device can now
show_infoand print a table output of all entered information
activeEntryInfo should default to True
Moved the tests directory into the package to make it easily importable by other modules hoping to use a MockClient
Introduced explicit dependencies on