File tree Expand file tree Collapse file tree 3 files changed +93
-14
lines changed Expand file tree Collapse file tree 3 files changed +93
-14
lines changed Original file line number Diff line number Diff line change 3
3
"""
4
4
5
5
# isort:skip_file
6
- from ._version import __version__
6
+ from ._version import __version__ as __version__
7
7
8
8
from .allunits import (
9
9
# basic units
185
185
Twatt ,
186
186
)
187
187
188
- from .fundamentalunits import *
189
- from .fundamentalunits import __all__ as fundamentalunits_all
190
-
191
- from .stdunits import *
192
- from .stdunits import __all__ as stdunits_all
188
+ from .fundamentalunits import (
189
+ DimensionMismatchError ,
190
+ get_or_create_dimension ,
191
+ get_dimensions ,
192
+ is_dimensionless ,
193
+ have_same_dimensions ,
194
+ in_unit ,
195
+ in_best_unit ,
196
+ Quantity ,
197
+ Unit ,
198
+ register_new_unit ,
199
+ check_units ,
200
+ is_scalar_type ,
201
+ get_unit ,
202
+ )
193
203
204
+ from .stdunits import (
205
+ mV ,
206
+ mA ,
207
+ uA ,
208
+ nA ,
209
+ pA ,
210
+ pF ,
211
+ uF ,
212
+ nF ,
213
+ nS ,
214
+ uS ,
215
+ mS ,
216
+ ms ,
217
+ us ,
218
+ Hz ,
219
+ kHz ,
220
+ MHz ,
221
+ cm ,
222
+ cm2 ,
223
+ cm3 ,
224
+ mm ,
225
+ mm2 ,
226
+ mm3 ,
227
+ um ,
228
+ um2 ,
229
+ um3 ,
230
+ mM ,
231
+ uM ,
232
+ nM ,
233
+ )
194
234
195
235
__all__ = [
196
236
"pamp" ,
369
409
"Mwatt" ,
370
410
"Gwatt" ,
371
411
"Twatt" ,
412
+ # from fundamentalunits
413
+ "DimensionMismatchError" ,
414
+ "get_or_create_dimension" ,
415
+ "get_dimensions" ,
416
+ "is_dimensionless" ,
417
+ "have_same_dimensions" ,
418
+ "in_unit" ,
419
+ "in_best_unit" ,
420
+ "Quantity" ,
421
+ "Unit" ,
422
+ "register_new_unit" ,
423
+ "check_units" ,
424
+ "is_scalar_type" ,
425
+ "get_unit" ,
426
+ # from stdunits
427
+ "mV" ,
428
+ "mA" ,
429
+ "uA" ,
430
+ "nA" ,
431
+ "pA" ,
432
+ "pF" ,
433
+ "uF" ,
434
+ "nF" ,
435
+ "nS" ,
436
+ "uS" ,
437
+ "mS" ,
438
+ "ms" ,
439
+ "us" ,
440
+ "Hz" ,
441
+ "kHz" ,
442
+ "MHz" ,
443
+ "cm" ,
444
+ "cm2" ,
445
+ "cm3" ,
446
+ "mm" ,
447
+ "mm2" ,
448
+ "mm3" ,
449
+ "um" ,
450
+ "um2" ,
451
+ "um3" ,
452
+ "mM" ,
453
+ "uM" ,
454
+ "nM" ,
372
455
]
373
- __all__ .extend (fundamentalunits_all )
374
- __all__ .extend (stdunits_all )
Original file line number Diff line number Diff line change @@ -2551,8 +2551,8 @@ def new_f(*args, **kwds):
2551
2551
if (
2552
2552
k in au
2553
2553
and not isinstance (newkeyset [k ], str )
2554
- and not newkeyset [k ] is None
2555
- and not au [k ] is None
2554
+ and newkeyset [k ] is not None
2555
+ and au [k ] is not None
2556
2556
):
2557
2557
if au [k ] in (bool , np .bool_ ):
2558
2558
if not isinstance (newkeyset [k ], (bool , np .bool_ )):
@@ -2565,7 +2565,7 @@ def new_f(*args, **kwds):
2565
2565
)
2566
2566
raise TypeError (error_message )
2567
2567
elif isinstance (au [k ], str ):
2568
- if not au [k ] in newkeyset :
2568
+ if au [k ] not in newkeyset :
2569
2569
error_message = (
2570
2570
f"Function '{ f .__name__ } ' "
2571
2571
"expected its argument to have the "
@@ -2644,7 +2644,7 @@ def new_f(*args, **kwds):
2644
2644
new_f ._return_unit = None
2645
2645
else :
2646
2646
new_f ._return_unit = return_unit
2647
- if return_unit == bool :
2647
+ if return_unit is bool :
2648
2648
new_f ._returns_bool = True
2649
2649
else :
2650
2650
new_f ._returns_bool = False
Original file line number Diff line number Diff line change 1
- from pdm .backend .hooks .version import SCMVersion
2
-
3
1
def format_version (version ) -> str :
4
2
"""
5
3
Format the version number of the package. This function is only supposed to be
You can’t perform that action at this time.
0 commit comments