Skip to content

Commit 547ee97

Browse files
authored
Merge pull request #10 from brian-team:linter_changes
Linter changes
2 parents b36fa9e + eae52c8 commit 547ee97

File tree

3 files changed

+93
-14
lines changed

3 files changed

+93
-14
lines changed

src/QuantSI/__init__.py

Lines changed: 89 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
# isort:skip_file
6-
from ._version import __version__
6+
from ._version import __version__ as __version__
77

88
from .allunits import (
99
# basic units
@@ -185,12 +185,52 @@
185185
Twatt,
186186
)
187187

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+
)
193203

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+
)
194234

195235
__all__ = [
196236
"pamp",
@@ -369,6 +409,47 @@
369409
"Mwatt",
370410
"Gwatt",
371411
"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",
372455
]
373-
__all__.extend(fundamentalunits_all)
374-
__all__.extend(stdunits_all)

src/QuantSI/fundamentalunits.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2551,8 +2551,8 @@ def new_f(*args, **kwds):
25512551
if (
25522552
k in au
25532553
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
25562556
):
25572557
if au[k] in (bool, np.bool_):
25582558
if not isinstance(newkeyset[k], (bool, np.bool_)):
@@ -2565,7 +2565,7 @@ def new_f(*args, **kwds):
25652565
)
25662566
raise TypeError(error_message)
25672567
elif isinstance(au[k], str):
2568-
if not au[k] in newkeyset:
2568+
if au[k] not in newkeyset:
25692569
error_message = (
25702570
f"Function '{f.__name__}' "
25712571
"expected its argument to have the "
@@ -2644,7 +2644,7 @@ def new_f(*args, **kwds):
26442644
new_f._return_unit = None
26452645
else:
26462646
new_f._return_unit = return_unit
2647-
if return_unit == bool:
2647+
if return_unit is bool:
26482648
new_f._returns_bool = True
26492649
else:
26502650
new_f._returns_bool = False

src/version_helper.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from pdm.backend.hooks.version import SCMVersion
2-
31
def format_version(version) -> str:
42
"""
53
Format the version number of the package. This function is only supposed to be

0 commit comments

Comments
 (0)