lsst-utils 29.2025.2300__tar.gz → 29.2025.2600__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. {lsst_utils-29.2025.2300/python/lsst_utils.egg-info → lsst_utils-29.2025.2600}/PKG-INFO +1 -1
  2. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/doc/lsst.utils/CHANGES.rst +43 -0
  3. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/plotting/figures.py +7 -6
  4. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/plotting/publication_plots.py +19 -6
  5. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/timer.py +11 -4
  6. lsst_utils-29.2025.2600/python/lsst/utils/version.py +2 -0
  7. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600/python/lsst_utils.egg-info}/PKG-INFO +1 -1
  8. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_matplotlib_figures.py +14 -1
  9. lsst_utils-29.2025.2300/python/lsst/utils/version.py +0 -2
  10. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/COPYRIGHT +0 -0
  11. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/LICENSE +0 -0
  12. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/MANIFEST.in +0 -0
  13. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/README.rst +0 -0
  14. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/doc/lsst.utils/index.rst +0 -0
  15. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/pyproject.toml +0 -0
  16. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/__init__.py +0 -0
  17. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/__init__.py +0 -0
  18. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/_packaging.py +0 -0
  19. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/argparsing.py +0 -0
  20. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/classes.py +0 -0
  21. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/db_auth.py +0 -0
  22. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/deprecated.py +0 -0
  23. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/doImport.py +0 -0
  24. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/inheritDoc.py +0 -0
  25. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/introspection.py +0 -0
  26. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/iteration.py +0 -0
  27. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/logging.py +0 -0
  28. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/packages.py +0 -0
  29. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/plotting/__init__.py +0 -0
  30. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/plotting/limits.py +0 -0
  31. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/plotting/rubin.mplstyle +0 -0
  32. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/py.typed +0 -0
  33. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/tests.py +0 -0
  34. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/threads.py +0 -0
  35. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/usage.py +0 -0
  36. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst/utils/wrappers.py +0 -0
  37. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst_utils.egg-info/SOURCES.txt +0 -0
  38. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst_utils.egg-info/dependency_links.txt +0 -0
  39. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst_utils.egg-info/requires.txt +0 -0
  40. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst_utils.egg-info/top_level.txt +0 -0
  41. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/python/lsst_utils.egg-info/zip-safe +0 -0
  42. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/setup.cfg +0 -0
  43. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_argparsing.py +0 -0
  44. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_classes.py +0 -0
  45. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_db_auth.py +0 -0
  46. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_decorators.py +0 -0
  47. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_deprecated.py +0 -0
  48. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_doImport.py +0 -0
  49. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_executables.py +0 -0
  50. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_getPackageDir.py +0 -0
  51. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_getTempFilePath.py +0 -0
  52. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_import.py +0 -0
  53. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_inheritDoc.py +0 -0
  54. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_introspection.py +0 -0
  55. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_iteration.py +0 -0
  56. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_logging.py +0 -0
  57. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_ordering.py +0 -0
  58. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_packages.py +0 -0
  59. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_plotting_limits.py +0 -0
  60. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_threads.py +0 -0
  61. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_timer.py +0 -0
  62. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_usage.py +0 -0
  63. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_utils.py +0 -0
  64. {lsst_utils-29.2025.2300 → lsst_utils-29.2025.2600}/tests/test_wrappers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lsst-utils
3
- Version: 29.2025.2300
3
+ Version: 29.2025.2600
4
4
  Summary: Utility functions from Rubin Observatory Data Management for the Legacy Survey of Space and Time (LSST).
5
5
  Author-email: Rubin Observatory Data Management <dm-admin@lists.lsst.org>
6
6
  License: BSD 3-Clause License
@@ -1,3 +1,46 @@
1
+ lsst-utils v29.1.1 (2025-06-19)
2
+ ===============================
3
+
4
+ Miscellaneous Changes of Minor Interest
5
+ ---------------------------------------
6
+
7
+ - Updated multiband plot colors (with white background) for improved colorblind accessibility. (`DM-51451 <https://rubinobs.atlassian.net/browse/DM-51451>`_)
8
+ - Add some minor changes to plotting utilities, for example adding a default color for SSO objects
9
+ (`DM-50892 <https://rubinobs.atlassian.net/browse/DM-50892>`_)
10
+
11
+ lsst-utils v29.1.0 (2025-05-22)
12
+ ===============================
13
+
14
+ New Features
15
+ ------------
16
+
17
+ - Added support for ``LSST_UTILS_DISABLE_TIMER`` environment variable to turn off the timing decorator to produce more useful profiling output. (`DM-34978 <https://rubinobs.atlassian.net/browse/DM-34978>`_)
18
+ - Added ``lsst.utils.argparsing.AppendDict`` which inherits from ``argparsing.Action``.
19
+ This utility for argument parsing enables multiple optional parameters in command line interfaces.
20
+ It receives ``key:value`` parameters and parses them to a dictionary. (`DM-46249 <https://rubinobs.atlassian.net/browse/DM-46249>`_)
21
+ - Added the name of the node on which the process is running to the ``obj.metadata`` written by the logger. (`DM-48671 <https://rubinobs.atlassian.net/browse/DM-48671>`_)
22
+ - * Added new ``lsst.utils.plotting.publication_plots``, which contains a ``set_rubin_plotstyle`` function for applying a standard matplotlib style to ensure consistency of plots across the project.
23
+ Also added the ``rubin.mplstyle`` file itself.
24
+ * Added a convenience function called ``get_band_dicts`` in ``lsst.utils.plotting.publication_plots`` to retrieve the band-dependent definitions of plotting colors, symbols, and linestyles. (`DM-49728 <https://rubinobs.atlassian.net/browse/DM-49728>`_)
25
+ - ``DbAuth`` now supports reading the credentials directly from a JSON string stored in an environment variable.
26
+ The default environment variable is ``LSST_DB_AUTH_CREDENTIALS`` and takes priority over reading from files. (`DM-49860 <https://rubinobs.atlassian.net/browse/DM-49860>`_)
27
+
28
+
29
+ API Changes
30
+ -----------
31
+
32
+ - ``DbAuth`` constructor now provides default values for path and environment variable name.
33
+ This avoids the need to specify the same values in each package that uses ``DbAuth``. (`DM-44862 <https://rubinobs.atlassian.net/browse/DM-44862>`_)
34
+
35
+
36
+ Miscellaneous Changes of Minor Interest
37
+ ---------------------------------------
38
+
39
+ - Modified ``lsst.utils.timer.time_this`` such that it can now return an object that will contain the duration and, potentially, memory usage when the context closes.
40
+ This allows for metrics to be gathered even if no log message is delivered.
41
+ As part of this a new ``force_mem_usage`` parameter has been added that will always calculate the (slow) memory statistics even if no log message was to be delivered. (`DM-50490 <https://rubinobs.atlassian.net/browse/DM-50490>`_)
42
+
43
+
1
44
  lsst-utils v29.0.0 (2025-03-24)
2
45
  ===============================
3
46
 
@@ -81,13 +81,14 @@ def get_multiband_plot_colors(dark_background: bool = False) -> dict:
81
81
  Mapping of the LSST bands to colors.
82
82
  """
83
83
  plot_filter_colors_white_background = {
84
- "u": "#0c71ff",
85
- "g": "#49be61",
86
- "r": "#c61c00",
87
- "i": "#ffc200",
88
- "z": "#f341a2",
89
- "y": "#5d0000",
84
+ "u": "#61A2B3",
85
+ "g": "#31DE1F",
86
+ "r": "#B52626",
87
+ "i": "#1600EA",
88
+ "z": "#BA52FF",
89
+ "y": "#370201",
90
90
  }
91
+
91
92
  plot_filter_colors_black_background = {
92
93
  "u": "#3eb7ff",
93
94
  "g": "#30c39f",
@@ -18,6 +18,8 @@ __all__ = [
18
18
  "get_band_dicts",
19
19
  "mk_colormap",
20
20
  "set_rubin_plotstyle",
21
+ "sso_cmap",
22
+ "sso_color",
21
23
  "stars_cmap",
22
24
  "stars_color",
23
25
  ]
@@ -77,7 +79,7 @@ def mk_colormap(colorNames): # type: ignore
77
79
  else:
78
80
  nums = np.linspace(0, 1, len(colorNames))
79
81
  if len(colorNames) == 3:
80
- alphaRange = [1.0, 0.3, 1.0]
82
+ alphaRange = [1.0, 1.0, 1.0]
81
83
  elif len(colorNames) == 5:
82
84
  alphaRange = [1.0, 0.7, 0.3, 0.7, 1.0]
83
85
  else:
@@ -99,10 +101,7 @@ def divergent_cmap(): # type: ignore
99
101
  """
100
102
  Make a divergent color map.
101
103
  """
102
- import seaborn as sns
103
- from matplotlib.colors import ListedColormap
104
-
105
- cmap = ListedColormap(sns.color_palette("icefire", 256))
104
+ cmap = mk_colormap([stars_color(), "#D9DCDE", accent_color()])
106
105
 
107
106
  return cmap
108
107
 
@@ -121,7 +120,7 @@ def stars_cmap(single_color=False): # type: ignore
121
120
 
122
121
  def stars_color() -> str:
123
122
  """Return the star color string for lines"""
124
- return "#357BA3"
123
+ return "#084d96"
125
124
 
126
125
 
127
126
  def accent_color() -> str:
@@ -146,6 +145,20 @@ def galaxies_color() -> str:
146
145
  return "#961A45"
147
146
 
148
147
 
148
+ def sso_color() -> str:
149
+ """Return the SSO color string for lines"""
150
+ return "#01694c"
151
+
152
+
153
+ def sso_cmap(single_color=False): # type: ignore
154
+ """Make a color map for solar system objects."""
155
+ if single_color:
156
+ cmap = mk_colormap([sso_color()])
157
+ else:
158
+ cmap = "viridis"
159
+ return cmap
160
+
161
+
149
162
  def get_band_dicts() -> dict:
150
163
  """
151
164
  Define palettes, from RTN-045. This includes dicts for colors (bandpass
@@ -553,7 +553,7 @@ def duration_from_timeMethod(
553
553
  method_name : `str`
554
554
  Name of the timed method to extract a duration for.
555
555
  clock : `str`, optional
556
- Options are "Cpu", "User", or "System".
556
+ Options are "Cpu", "User", "System", or "Utc".
557
557
 
558
558
  Returns
559
559
  -------
@@ -562,10 +562,17 @@ def duration_from_timeMethod(
562
562
  """
563
563
  if metadata is None:
564
564
  return None
565
- start = metadata[method_name + "Start" + clock + "Time"]
565
+ if clock.lower() == "utc":
566
+ start = metadata[method_name + "StartUtc"]
567
+ end = metadata[method_name + "EndUtc"]
568
+ else:
569
+ start = metadata[method_name + "Start" + clock + "Time"]
570
+ end = metadata[method_name + "End" + clock + "Time"]
566
571
  if isinstance(start, list):
567
572
  start = start[-1]
568
- end = metadata[method_name + "End" + clock + "Time"]
569
573
  if isinstance(end, list):
570
574
  end = end[-1]
571
- return end - start
575
+ if isinstance(start, str) and isinstance(end, str):
576
+ return (datetime.datetime.fromisoformat(end) - datetime.datetime.fromisoformat(start)).total_seconds()
577
+ else:
578
+ return end - start
@@ -0,0 +1,2 @@
1
+ __all__ = ["__version__"]
2
+ __version__ = "29.2025.2600"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lsst-utils
3
- Version: 29.2025.2300
3
+ Version: 29.2025.2600
4
4
  Summary: Utility functions from Rubin Observatory Data Management for the Legacy Survey of Space and Time (LSST).
5
5
  Author-email: Rubin Observatory Data Management <dm-admin@lists.lsst.org>
6
6
  License: BSD 3-Clause License
@@ -34,6 +34,8 @@ from lsst.utils.plotting import (
34
34
  make_figure,
35
35
  mk_colormap,
36
36
  set_rubin_plotstyle,
37
+ sso_cmap,
38
+ sso_color,
37
39
  stars_cmap,
38
40
  stars_color,
39
41
  )
@@ -93,7 +95,7 @@ class PublicationPlotsTestCase(unittest.TestCase):
93
95
 
94
96
  def testMultibandPlotColors(self):
95
97
  bands_dict = get_band_dicts()
96
- self.assertEqual(bands_dict["colors"]["r"], "#c61c00")
98
+ self.assertEqual(bands_dict["colors"]["r"], "#B52626")
97
99
  self.assertEqual(bands_dict["colors_black"]["r"], "#ff7e00")
98
100
  self.assertEqual(bands_dict["symbols"]["r"], "v")
99
101
  self.assertEqual(bands_dict["line_styles"]["r"], "-.")
@@ -130,6 +132,17 @@ class PublicationPlotsTestCase(unittest.TestCase):
130
132
  ax.axhline(0, color=accent_color())
131
133
  fig.savefig(tmpFile)
132
134
 
135
+ def testSSOColor(self):
136
+ with lsst.utils.tests.getTempFilePath(".png") as tmpFile:
137
+ fig = make_figure()
138
+ ax = fig.add_subplot(111)
139
+ xs = [0, 1]
140
+ ys = [0, 1]
141
+ for cmap in [sso_cmap(), sso_cmap(single_color=True)]:
142
+ ax.hexbin(xs, ys, cmap=cmap)
143
+ ax.axhline(0, color=sso_color())
144
+ fig.savefig(tmpFile)
145
+
133
146
  def testMkColormap(self):
134
147
  mk_colormap(["#fde725", "#21918c", "#440154"])
135
148
  mk_colormap(["#fde725", "#5ec962", "#21918c", "#3b528b"])
@@ -1,2 +0,0 @@
1
- __all__ = ["__version__"]
2
- __version__ = "29.2025.2300"