lsst-utils 30.0.0rc2__py3-none-any.whl → 30.0.1rc1__py3-none-any.whl
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.
- lsst/utils/deprecated.py +4 -4
- lsst/utils/inheritDoc.py +2 -2
- lsst/utils/iteration.py +32 -29
- lsst/utils/logging.py +2 -2
- lsst/utils/timer.py +2 -2
- lsst/utils/version.py +1 -1
- lsst/utils/wrappers.py +4 -4
- {lsst_utils-30.0.0rc2.dist-info → lsst_utils-30.0.1rc1.dist-info}/METADATA +2 -1
- {lsst_utils-30.0.0rc2.dist-info → lsst_utils-30.0.1rc1.dist-info}/RECORD +14 -14
- {lsst_utils-30.0.0rc2.dist-info → lsst_utils-30.0.1rc1.dist-info}/WHEEL +1 -1
- {lsst_utils-30.0.0rc2.dist-info → lsst_utils-30.0.1rc1.dist-info}/licenses/COPYRIGHT +0 -0
- {lsst_utils-30.0.0rc2.dist-info → lsst_utils-30.0.1rc1.dist-info}/licenses/LICENSE +0 -0
- {lsst_utils-30.0.0rc2.dist-info → lsst_utils-30.0.1rc1.dist-info}/top_level.txt +0 -0
- {lsst_utils-30.0.0rc2.dist-info → lsst_utils-30.0.1rc1.dist-info}/zip-safe +0 -0
lsst/utils/deprecated.py
CHANGED
|
@@ -35,11 +35,11 @@ def deprecate_pybind11(obj: Any, reason: str, version: str, category: type[Warni
|
|
|
35
35
|
|
|
36
36
|
Parameters
|
|
37
37
|
----------
|
|
38
|
-
obj :
|
|
38
|
+
obj : `~collections.abc.Callable`
|
|
39
39
|
The function, method, or class to deprecate.
|
|
40
40
|
reason : `str`
|
|
41
41
|
Reason for deprecation, passed to `~deprecated.sphinx.deprecated`.
|
|
42
|
-
version :
|
|
42
|
+
version : `str`
|
|
43
43
|
Next major version in which the interface will be deprecated,
|
|
44
44
|
passed to `~deprecated.sphinx.deprecated`.
|
|
45
45
|
category : `Warning`
|
|
@@ -47,7 +47,7 @@ def deprecate_pybind11(obj: Any, reason: str, version: str, category: type[Warni
|
|
|
47
47
|
|
|
48
48
|
Returns
|
|
49
49
|
-------
|
|
50
|
-
obj :
|
|
50
|
+
obj : `~collections.abc.Callable`
|
|
51
51
|
Wrapped function, method, or class.
|
|
52
52
|
|
|
53
53
|
Examples
|
|
@@ -88,7 +88,7 @@ def suppress_deprecations(category: type[Warning] = FutureWarning) -> Iterator[N
|
|
|
88
88
|
|
|
89
89
|
Parameters
|
|
90
90
|
----------
|
|
91
|
-
category : `Warning`
|
|
91
|
+
category : `Warning`
|
|
92
92
|
The category of warning to suppress.
|
|
93
93
|
"""
|
|
94
94
|
with warnings.catch_warnings():
|
lsst/utils/inheritDoc.py
CHANGED
|
@@ -28,12 +28,12 @@ def inheritDoc(klass: type) -> Callable:
|
|
|
28
28
|
|
|
29
29
|
Parameters
|
|
30
30
|
----------
|
|
31
|
-
klass :
|
|
31
|
+
klass : `type`
|
|
32
32
|
The class to inherit documentation from.
|
|
33
33
|
|
|
34
34
|
Returns
|
|
35
35
|
-------
|
|
36
|
-
decorator :
|
|
36
|
+
decorator : `~collections.abc.Callable`
|
|
37
37
|
Intermediate decorator used in the documentation process.
|
|
38
38
|
|
|
39
39
|
Notes
|
lsst/utils/iteration.py
CHANGED
|
@@ -26,10 +26,10 @@ def chunk_iterable(data: Iterable[Any], chunk_size: int = 1_000) -> Iterator[tup
|
|
|
26
26
|
|
|
27
27
|
Parameters
|
|
28
28
|
----------
|
|
29
|
-
data :
|
|
29
|
+
data : `~collections.abc.Iterable` [ `typing.Any` ] of anything
|
|
30
30
|
The iterable to be chunked. Can be a mapping, in which case
|
|
31
31
|
the keys are returned in chunks.
|
|
32
|
-
chunk_size : int
|
|
32
|
+
chunk_size : `int`, optional
|
|
33
33
|
The largest chunk to return. Can be smaller and depends on the
|
|
34
34
|
number of elements in the iterator. Defaults to 1_000.
|
|
35
35
|
|
|
@@ -58,7 +58,7 @@ def ensure_iterable(a: Any) -> Iterable[Any]:
|
|
|
58
58
|
|
|
59
59
|
Parameters
|
|
60
60
|
----------
|
|
61
|
-
a :
|
|
61
|
+
a : `~collections.abc.Iterable` or `str` or not iterable
|
|
62
62
|
Argument to be converted to an iterable.
|
|
63
63
|
|
|
64
64
|
Returns
|
|
@@ -115,18 +115,19 @@ def _extract_numeric_suffix(s: str) -> tuple[str, int | None]:
|
|
|
115
115
|
Returns the prefix and the numeric suffix as an integer, if present.
|
|
116
116
|
|
|
117
117
|
For example:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
|
|
119
|
+
'node1' -> ('node', 1)
|
|
120
|
+
'node' -> ('node', None)
|
|
121
|
+
'node123abc' -> ('node123abc', None)
|
|
121
122
|
|
|
122
123
|
Parameters
|
|
123
124
|
----------
|
|
124
|
-
s : str
|
|
125
|
+
s : `str`
|
|
125
126
|
The string to extract the numeric suffix from.
|
|
126
127
|
|
|
127
128
|
Returns
|
|
128
129
|
-------
|
|
129
|
-
suffix : str
|
|
130
|
+
suffix : `str`
|
|
130
131
|
The numeric suffix of the string, if any.
|
|
131
132
|
"""
|
|
132
133
|
index = len(s)
|
|
@@ -151,13 +152,13 @@ def _add_pair_to_name(val_name: list[str], val0: int | str, val1: int | str, str
|
|
|
151
152
|
|
|
152
153
|
Parameters
|
|
153
154
|
----------
|
|
154
|
-
val_name :
|
|
155
|
+
val_name : `list` [ `str` ]
|
|
155
156
|
The list to append the formatted string to.
|
|
156
|
-
val0 :
|
|
157
|
+
val0 : `int` or `str`
|
|
157
158
|
The starting value of the sequence.
|
|
158
|
-
val1 :
|
|
159
|
+
val1 : `int` or `str`
|
|
159
160
|
The ending value of the sequence.
|
|
160
|
-
stride : int
|
|
161
|
+
stride : `int`, optional
|
|
161
162
|
The stride or difference between consecutive numbers in the
|
|
162
163
|
sequence. Defaults to 1.
|
|
163
164
|
"""
|
|
@@ -195,12 +196,12 @@ def _is_list_of_ints(values: list[int | str]) -> TypeGuard[list[int]]:
|
|
|
195
196
|
|
|
196
197
|
Parameters
|
|
197
198
|
----------
|
|
198
|
-
values :
|
|
199
|
+
values : `list` [`int` or `str`]:
|
|
199
200
|
The list of values to check.
|
|
200
201
|
|
|
201
202
|
Returns
|
|
202
203
|
-------
|
|
203
|
-
is_ints : bool
|
|
204
|
+
is_ints : `bool`
|
|
204
205
|
True if all values are integers, False otherwise.
|
|
205
206
|
"""
|
|
206
207
|
return all(isinstance(v, int) for v in values)
|
|
@@ -217,31 +218,33 @@ def sequence_to_string(values: list[int | str]) -> str:
|
|
|
217
218
|
strings with common prefixes are handled to produce a concise
|
|
218
219
|
representation.
|
|
219
220
|
|
|
220
|
-
>>> getNameOfSet([1, 2, 3, 5, 7, 8, 9])
|
|
221
|
-
'1..3^5^7..9'
|
|
222
|
-
>>> getNameOfSet(["node1", "node2", "node3"])
|
|
223
|
-
'node1..node3'
|
|
224
|
-
>>> getNameOfSet([10, 20, 30, 40])
|
|
225
|
-
'10..40:10'
|
|
226
|
-
|
|
227
221
|
Parameters
|
|
228
222
|
----------
|
|
229
|
-
values : list[int
|
|
223
|
+
values : `list` [ `int` or `str` ]
|
|
230
224
|
A list of items to be compacted. Must all be of the same type.
|
|
231
225
|
|
|
232
226
|
Returns
|
|
233
227
|
-------
|
|
234
|
-
sequence_as_string : str
|
|
228
|
+
sequence_as_string : `str`
|
|
235
229
|
A compact string representation of the input list.
|
|
236
230
|
|
|
237
231
|
Notes
|
|
238
232
|
-----
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
233
|
+
- The function handles both integers and strings.
|
|
234
|
+
- For strings with common prefixes, only the differing suffixes are
|
|
235
|
+
considered.
|
|
236
|
+
- The stride is determined as the minimum difference between
|
|
237
|
+
consecutive numbers.
|
|
238
|
+
- Strings without common prefixes are listed individually.
|
|
239
|
+
|
|
240
|
+
Examples
|
|
241
|
+
--------
|
|
242
|
+
>>> getNameOfSet([1, 2, 3, 5, 7, 8, 9])
|
|
243
|
+
'1..3^5^7..9'
|
|
244
|
+
>>> getNameOfSet(["node1", "node2", "node3"])
|
|
245
|
+
'node1..node3'
|
|
246
|
+
>>> getNameOfSet([10, 20, 30, 40])
|
|
247
|
+
'10..40:10'
|
|
245
248
|
"""
|
|
246
249
|
if not values:
|
|
247
250
|
return ""
|
lsst/utils/logging.py
CHANGED
|
@@ -273,7 +273,7 @@ class LsstLogAdapter(LoggerAdapter):
|
|
|
273
273
|
*args : `~typing.Any`
|
|
274
274
|
Parameters references by log message.
|
|
275
275
|
**kwargs : `~typing.Any`
|
|
276
|
-
Parameters forwarded to
|
|
276
|
+
Parameters forwarded to underlying logger.
|
|
277
277
|
"""
|
|
278
278
|
# There is no other way to achieve this other than a special logger
|
|
279
279
|
# method.
|
|
@@ -294,7 +294,7 @@ class LsstLogAdapter(LoggerAdapter):
|
|
|
294
294
|
*args : `~typing.Any`
|
|
295
295
|
Parameters references by log message.
|
|
296
296
|
**kwargs : `~typing.Any`
|
|
297
|
-
Parameters forwarded to
|
|
297
|
+
Parameters forwarded to underlying logger.
|
|
298
298
|
"""
|
|
299
299
|
# There is no other way to achieve this other than a special logger
|
|
300
300
|
# method.
|
lsst/utils/timer.py
CHANGED
|
@@ -165,7 +165,7 @@ def logInfo(
|
|
|
165
165
|
Name prefix, the resulting entries are ``CpuTime``, etc.. For example
|
|
166
166
|
`timeMethod` uses ``prefix = Start`` when the method begins and
|
|
167
167
|
``prefix = End`` when the method ends.
|
|
168
|
-
logLevel : optional
|
|
168
|
+
logLevel : `int`, optional
|
|
169
169
|
Log level (a `logging` level constant, such as `logging.DEBUG`).
|
|
170
170
|
metadata : `collections.abc.MutableMapping`, optional
|
|
171
171
|
Metadata object to write entries to, overriding ``obj.metadata``.
|
|
@@ -399,7 +399,7 @@ def time_this(
|
|
|
399
399
|
Prefix to use to prepend to the supplied logger to
|
|
400
400
|
create a new logger to use instead. No prefix is used if the value
|
|
401
401
|
is set to `None`. Defaults to "timer".
|
|
402
|
-
args :
|
|
402
|
+
args : `~collections.abc.Iterable` [ `typing.Any` ]
|
|
403
403
|
Additional parameters passed to the log command that should be
|
|
404
404
|
written to ``msg``.
|
|
405
405
|
kwargs : `dict`, optional
|
lsst/utils/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__all__ = ["__version__"]
|
|
2
|
-
__version__ = "30.0.
|
|
2
|
+
__version__ = "30.0.1rc1"
|
lsst/utils/wrappers.py
CHANGED
|
@@ -186,7 +186,7 @@ class TemplateMeta(type):
|
|
|
186
186
|
classes with multiple template parameters) are good choices. Alternate
|
|
187
187
|
type keys for existing classes can be added by calling ``alias``, but only
|
|
188
188
|
after a subclass already been registered with a "primary" type key. For
|
|
189
|
-
example
|
|
189
|
+
example:
|
|
190
190
|
|
|
191
191
|
.. code-block:: python
|
|
192
192
|
|
|
@@ -210,7 +210,7 @@ class TemplateMeta(type):
|
|
|
210
210
|
|
|
211
211
|
This allows user code to construct objects directly using ``Image``, as
|
|
212
212
|
long as an extra ``dtype`` keyword argument is passed that matches one of
|
|
213
|
-
the type keys
|
|
213
|
+
the type keys:
|
|
214
214
|
|
|
215
215
|
.. code-block:: python
|
|
216
216
|
|
|
@@ -233,7 +233,7 @@ class TemplateMeta(type):
|
|
|
233
233
|
As an aid for those writing the Python wrappers for C++ classes,
|
|
234
234
|
``TemplateMeta`` also provides a way to add pure-Python methods and other
|
|
235
235
|
attributes to the wrapped template classes. To add a ``sum`` method to
|
|
236
|
-
all registered types, for example, we can just do
|
|
236
|
+
all registered types, for example, we can just do:
|
|
237
237
|
|
|
238
238
|
.. code-block:: python
|
|
239
239
|
|
|
@@ -259,7 +259,7 @@ class TemplateMeta(type):
|
|
|
259
259
|
|
|
260
260
|
Finally, abstract base classes that use ``TemplateMeta`` define a dict-
|
|
261
261
|
like interface for accessing their registered subclasses, providing
|
|
262
|
-
something like the C++ syntax for templates
|
|
262
|
+
something like the C++ syntax for templates:
|
|
263
263
|
|
|
264
264
|
.. code-block:: python
|
|
265
265
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lsst-utils
|
|
3
|
-
Version: 30.0.
|
|
3
|
+
Version: 30.0.1rc1
|
|
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-Expression: BSD-3-Clause
|
|
7
7
|
Project-URL: Homepage, https://github.com/lsst/utils
|
|
8
|
+
Project-URL: Source, https://github.com/lsst/utils
|
|
8
9
|
Keywords: lsst
|
|
9
10
|
Classifier: Intended Audience :: Developers
|
|
10
11
|
Classifier: Operating System :: OS Independent
|
|
@@ -4,29 +4,29 @@ lsst/utils/_packaging.py,sha256=4laBi-lHsNYHxms9tjyjMVwfmnwAltt-I2HWP-RE3Ds,1422
|
|
|
4
4
|
lsst/utils/argparsing.py,sha256=ITLsiANA4FEXc_ZKakX_U1beVez6WHdNoMeS8pC2CeY,2963
|
|
5
5
|
lsst/utils/classes.py,sha256=uTs1Coin5TlpH2rwD5RYh3m_JgMBYVnkg2jklb9Djnc,5467
|
|
6
6
|
lsst/utils/db_auth.py,sha256=qREqUDI7jXr49lY3bKhe75mbZsuAPu2zHaAtel30EEY,12924
|
|
7
|
-
lsst/utils/deprecated.py,sha256=
|
|
7
|
+
lsst/utils/deprecated.py,sha256=QeSy6PGW1Tv6oMQ4LILOVWcOacugtnDmbbI_hNTe__c,3488
|
|
8
8
|
lsst/utils/doImport.py,sha256=JbD_AR1GQ1PVdK--OJy5tVz1U2Kabe1ETyQoyaq6rpQ,4241
|
|
9
|
-
lsst/utils/inheritDoc.py,sha256=
|
|
9
|
+
lsst/utils/inheritDoc.py,sha256=uRTOM01VtjbM0xrDl6kWoSoftl_ip3glRYFE34o39vg,2738
|
|
10
10
|
lsst/utils/introspection.py,sha256=Y1ImDWl5i1O9iRbOoSJhr8Rz57y-_WMgwDtbGJBVxJk,14735
|
|
11
|
-
lsst/utils/iteration.py,sha256=
|
|
12
|
-
lsst/utils/logging.py,sha256=
|
|
11
|
+
lsst/utils/iteration.py,sha256=yoxj4OWWDxPjyxw3PB7mjPeEv4f2mD5sBD_tr8ar1-0,9386
|
|
12
|
+
lsst/utils/logging.py,sha256=LkYQ0Wb4-u1wTukAmD2b7wbryvRCV7jKZKey2GYrFrI,16280
|
|
13
13
|
lsst/utils/packages.py,sha256=XGtZCGkxqUCiyHi6LZDakV7tgoxtvABww7Haen84Yj8,27530
|
|
14
14
|
lsst/utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
lsst/utils/tests.py,sha256=eEcgGuHfaLorLlPUqwUNbWeO4A_2_r8ON8vTdlhcrek,39185
|
|
16
16
|
lsst/utils/threads.py,sha256=WNl3uvbE7bx5UyxTX0fwN5AkU3Yty_m8y_pMKcMCdv8,2551
|
|
17
|
-
lsst/utils/timer.py,sha256
|
|
17
|
+
lsst/utils/timer.py,sha256=-B59CIClWibwgbO_WYLd5QNRC6Te0HbRsiKr3soLCDc,21997
|
|
18
18
|
lsst/utils/usage.py,sha256=qunydx-KlcbNp-vFcBtvBayWwZAa0tHtSWvz5BycvLA,4598
|
|
19
|
-
lsst/utils/version.py,sha256
|
|
20
|
-
lsst/utils/wrappers.py,sha256=
|
|
19
|
+
lsst/utils/version.py,sha256=-auEgPcWk4qAWrWVMJY7Of7dAJ0dNQHoqQraCNdAEN4,52
|
|
20
|
+
lsst/utils/wrappers.py,sha256=Nj9E961PLhLOG5zq62DMraxmobj4-Sg9ChajGgZ_yUE,19205
|
|
21
21
|
lsst/utils/plotting/__init__.py,sha256=OEAZv2W12UAcUfDxH5H_k8v7cK4fVTOssuqNksZTuIs,507
|
|
22
22
|
lsst/utils/plotting/figures.py,sha256=pLkD7MpYk1Zs2hozA2-6r_uUd1129Uoi9EAEkMvtCjk,4356
|
|
23
23
|
lsst/utils/plotting/limits.py,sha256=6ilPmb4wg4aVtjlBgm75FPBrjDVSkW_ywZrj_QIQD2U,5839
|
|
24
24
|
lsst/utils/plotting/publication_plots.py,sha256=-uOL2ptI3N52KxfhtJNsUt7SqeGdT78GF-_QjHKKmV8,5016
|
|
25
25
|
lsst/utils/plotting/rubin.mplstyle,sha256=mjLPYzolUjeCXq8z4ltXLvEf8IuyT4TS0Nx8JJ05v6I,1063
|
|
26
|
-
lsst_utils-30.0.
|
|
27
|
-
lsst_utils-30.0.
|
|
28
|
-
lsst_utils-30.0.
|
|
29
|
-
lsst_utils-30.0.
|
|
30
|
-
lsst_utils-30.0.
|
|
31
|
-
lsst_utils-30.0.
|
|
32
|
-
lsst_utils-30.0.
|
|
26
|
+
lsst_utils-30.0.1rc1.dist-info/licenses/COPYRIGHT,sha256=I6Bxnp_LkIqDjafZNIXM8jfjYWC4XIlpNpZ7jkdeZK0,361
|
|
27
|
+
lsst_utils-30.0.1rc1.dist-info/licenses/LICENSE,sha256=7wrtgl8meQ0_RIuv2TjIKpAnNrl-ODH-QLwyHe9citI,1516
|
|
28
|
+
lsst_utils-30.0.1rc1.dist-info/METADATA,sha256=13P9kg8JfcI1Ftv3BF8lT8rBi5BOfbMDxg4pkyvPfCc,1818
|
|
29
|
+
lsst_utils-30.0.1rc1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
30
|
+
lsst_utils-30.0.1rc1.dist-info/top_level.txt,sha256=eUWiOuVVm9wwTrnAgiJT6tp6HQHXxIhj2QSZ7NYZH80,5
|
|
31
|
+
lsst_utils-30.0.1rc1.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
32
|
+
lsst_utils-30.0.1rc1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|