lsst-utils v29.1.1 (2025-06-19)¶
Miscellaneous Changes of Minor Interest¶
lsst-utils v29.1.0 (2025-05-22)¶
New Features¶
- Added support for - LSST_UTILS_DISABLE_TIMERenvironment variable to turn off the timing decorator to produce more useful profiling output. (DM-34978)
- Added - lsst.utils.argparsing.AppendDictwhich inherits from- argparsing.Action. This utility for argument parsing enables multiple optional parameters in command line interfaces. It receives- key:valueparameters and parses them to a dictionary. (DM-46249)
- Added the name of the node on which the process is running to the - obj.metadatawritten by the logger. (DM-48671)
- Added new - lsst.utils.plotting.publication_plots, which contains a- set_rubin_plotstylefunction for applying a standard matplotlib style to ensure consistency of plots across the project. Also added the- rubin.mplstylefile itself.
- Added a convenience function called - get_band_dictsin- lsst.utils.plotting.publication_plotsto retrieve the band-dependent definitions of plotting colors, symbols, and linestyles. (DM-49728)
 
- DbAuthnow supports reading the credentials directly from a JSON string stored in an environment variable. The default environment variable is- LSST_DB_AUTH_CREDENTIALSand takes priority over reading from files. (DM-49860)
API Changes¶
- DbAuthconstructor now provides default values for path and environment variable name. This avoids the need to specify the same values in each package that uses- DbAuth. (DM-44862)
Miscellaneous Changes of Minor Interest¶
- Modified - lsst.utils.timer.time_thissuch that it can now return an object that will contain the duration and, potentially, memory usage when the context closes. This allows for metrics to be gathered even if no log message is delivered. As part of this a new- force_mem_usageparameter has been added that will always calculate the (slow) memory statistics even if no log message was to be delivered. (DM-50490)
lsst-utils v29.0.0 (2025-03-24)¶
New Features¶
- Added - lsst.utils.plotting.get_multiband_plot_colors,- lsst.utils.plotting.get_multiband_plot_linestyles, and- lsst.utils.plotting.get_multiband_plot_symbolsutilities for making consistent multi-band plots. (DM-47821)
- Add new - lsst.utils.packages.getAllPythonDistributionsfunction for retrieving the versions of all installed Python distributions regardless of what has been imported.
- Modified - Packages.fromSystemto add a flag,- include_all, to control whether all installed Python distributions and EUPS packages should be reported and not solely the (default) imported distributions and locally-setup EUPS packages. All installed Conda packages are always reported.
- Modified - lsst.utils.packages.getPythonPackagesto no longer report packages that are part of the Python standard library. It is sufficient to record the Python version (via the- pythonkey). (DM-48430)
 
Miscellaneous Changes of Minor Interest¶
- Modified - time_thisso that exceptions occurring within the timer no longer change the log level to- ERROR. Instead the log level remains unchanged but the exception information is included in the log message. This allows the viewer to see why the timing might be different but also prevents log messages appearing when some code higher up caught the exception and continued on. (DM-47310)
An API Removal or Deprecation¶
- Removed - lsst.utils.ellipsis. This code was no longer necessary since python 3.10 and has been replaced by- types.EllipsisType. (DM-47310)
lsst-utils v28.0.0 (2024-11-19)¶
New Features¶
- Added - lsst.utils.iteration.sequence_to_range_str()to compactify lists of numbers for human reading and understanding. (DM-46813)
- Added - lsst.utils.introspection.take_object_censusand- lsst.utils.introspection.trace_object_referencesfunctions for characterizing memory leaks. (DM-45007)
- Added - lsst.utils.plotting.make_figure()utility to create a non-interactive- matplotlib- matploblib.figure.Figurewithout- matplotlib.pyplot. (DM-44725)
lsst-utils 27.0.0 (2024-05-28)¶
Now requires Python 3.10 or newer.
New Features¶
- Allow for skipping files in - ImportTestCaseusing- SKIP_FILESclass variable. (DM-40817)
Bug Fixes¶
- Fixed - inheritDocto insert newlines between the parent and child docstrings and also correct for indentation differences. (DM-22287)
- Fixed a race condition in - Singletonthat could cause more than one instance of a class to be created if two threads concurrently attempted to create the instance. (DM-42317)
Miscellaneous Changes of Minor Interest¶
- Export type aliases for LSST log adapters for use in downstream static typing. (DM-40441) 
- Changed how Conda package versions are discovered, resulting in a 10x speed up. No longer uses - conda list. (DM-40803)
- Use - packages_distributions()from- importlib.metadatato get mapping from import name to distribution name. (DM-42391)
lsst-utils v26.0.0 (2023-09-22)¶
This release no longer works with Python 3.8.
New Features¶
- Now works with Python 3.11. Python 3.11 now ensures that the - stacklevelparameter for logging methods is now consistent independent of how many method calls are involved internally. (DM-37987)
- Added - lsst.utils.tests.ImportTestCaseclass. This test case can be used to force the import of every file in a package. This can be very useful for spotting obvious problems if a package does not export every file by default. (DM-35901)
- Added a utility function, - calculate_safe_plotting_limits, located in- lsst.utils.plotting.limits, for calculating plotting limits for data with large outliers. (DM-38386)
- MemoryTestCasenow can accept an “ignore” list of regexps that match acceptable open files. (DM-38764)
- Adds an alternative way of interacting with - calculate_safe_plotting_limits().- This change adds a factory interface, such that one can use the function to accumulate the safe plotting limits over many different data series without having them all in-hand, by using the - make_calculate_safe_plotting_limits()function to return a- calculate_safe_plotting_limits()which will return the common limits after the addition of each new data series. The original behaviour remains unchanged. (DM-38900)
- Added - lsst.utils.introspection.find_outside_stacklevel. This function can be used to calculate the stack level that should be passed to warnings and log messages in order to make them look like they came from the line outside the specified package in user code. (DM-39628)
- Update the interface to - lsst.utils.introspection.find_outside_stacklevelto allow multiple modules to be skipped in the hierarchy and also specify that some methods and modules should not be skipped. (DM-40032)
- Added the ability for - find_outside_stacklevelto return additional information about the matching stack to the caller. This allows, for example, the filename and lineno to be reported without the caller making another call to- inspect.stack()or calling- get_caller_name. (DM-40367)
- Added the - lsst.utils.db_auth.DbAuthclass that has been relocated from- daf_butler. (DM-40462)
Bug Fixes¶
- Fixed - time_thiswhen- mem_usage=Trueto prevent memory statistics being gathered when the log message would not be issued. We had been trapping this on the exit to the context manager but not entry for the initial memory statistics gathering. (DM-38587)
- Updated the python version handling such that it is no longer a failure for the python package version to disagree with the - .versionproperty of that package. The package version is now used in preference if there is a disagreement. (DM-38665)
Miscellaneous Changes of Minor Interest¶
- Modified the code that determines the versions of Python packages so that it now uses - importlib.metadata. This is slightly slower than accessing- __version__but does give more consistent results. (DM-38812)
- Improved the performance of - lsst.utils.packages.getPythonPackages()to use the namespace hierarchy so it now only needs to check as deep into the hierarchy as is needed to find a version. Additionally, the code no longer tries to extract versions from Python standard library packages. (DM-39402)
An API Removal or Deprecation¶
- Dropped support for Python 3.8. (DM-35901) 
- Removed deprecated APIs from - lsst.utils.logging.
- Removed deprecated - demangleTypeand- backtracethat were forwarded from- cpputils.
- Removed - cpputilsfrom the EUPS table file. (DM-37534)
 
- A Mypy workaround in the - ellipsismodule is not needed for Python 3.10 or newer. Importing- lsst.utils.ellipsisin these Python versions will produce a- DeprecationWarning. (DM-39410)
- Removed deprecated - lsst.utils.get_caller_name. Use- lsst.utils.introspection. (DM-40032)
lsst-utils v25.0.0 (2023-02-17)¶
New Features¶
- Added - lsst.utils.timer.profileto allow code blocks to be profiled easily. (DM-35697)
Miscellaneous Changes of Minor Interest¶
lsst-utils v24.0.0 (2022-08-26)¶
New Features¶
- Add option to ignore NaNs in - lsst.utils.tests.assertFloatsAlmostEqual. (DM-29370)
- Add test decorators to operate on cartesian product. (DM-31141) 
- Several new packages added from - pipe_baseand- daf_butler:- lsst.utils.timer
- lsst.utils.classes
- lsst.utils.introspection
- lsst.utils.iteration
- lsst.utils.logging
 
- Added - lsst.utils.doImportTypeto import a python type from a string and guarantee it is not a module.
- lsst.utils.get_caller_nameis now deprecated in its current location and has been relocated to- lsst.utils.introspection. (DM-31722)
 
- Add - lsst.utils.logging.trace_set_atto control- TRACE-level loggers. (DM-32142)
- Builds using - setuptoolsnow calculate versions from the Git repository, including the use of alpha releases for those associated with weekly tags. (DM-32408)
- Context manager - lsst.utils.timer.time_thiscan now include memory usage in its report. (DM-33331)
- A new package - lsst.utils.packageshas been added to allow system package versions to be obtained. This code has been relocated from- lsst.base. (DM-33403)
- Add - lsst.utils.threadsfor control of threads. Use- lsst.utils.threads.disable_implicit_threading()to disable implicit threading. This function should be used in place of- lsst.base.disableImplicitThreading()in all new code. This package now depends on the- threadpoolctlpackage. (DM-33622)
- Added a new class - lsst.utils.logging.PeriodicLoggerto allow a user to issue log messages after some time interval has elapsed. (DM-33919)
- Added - lsst.utils.logging.getTraceLoggerto simplify the creation of a trace logger that uses a- TRACEnprefix for the logger name. (DM-34208)
API Changes¶
- The values for max resident set size stored in metadata are now consistently reported as bytes. Previously the units were platform specific (kibibytes on Liux and bytes on macOS). (DM-20970) 
- deprecate_pybind11now requires a- versionparameter. This matches the upstream requirement from- deprecated.deprecated(DM-29701)
- Add parameter to - getEnvironmentPackagesto return all EUPS packages rather than just those that are locally setup. (DM-33934)
Performance Enhancement¶
- Fixed an optimization when using - lsst.utils.TemplateMetaclasses with- isinstanceor- issubclass. (DM-32661)
lsst-utils v23.0.0 (2021-09-27)¶
- Moved all C++ code out of this package and into - cpputilspackage and changed license to BSD 3-clause. (DM-31721)
lsst-utils v22.0 (2021-07-09)¶
Bug fix¶
- Error reporting in - doImporthas been improved. [DM-27638]
lsst-utils v21.0 (2020-12-08)¶
New Features¶
- Added a temporary directory context manager - lsst.utils.tests.temporaryDirectory. [DM-26774]
API Change¶
- Add an optional - versionparameter to- lsst.utils.deprecate_pybind11. [DM-26285]