typedparser 0.12.4__tar.gz → 0.13.1__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.
- {typedparser-0.12.4 → typedparser-0.13.1}/PKG-INFO +5 -2
- {typedparser-0.12.4 → typedparser-0.13.1}/pyproject.toml +3 -0
- typedparser-0.13.1/requirements.txt +4 -0
- {typedparser-0.12.4 → typedparser-0.13.1}/src/typedparser/__init__.py +1 -1
- {typedparser-0.12.4 → typedparser-0.13.1}/src/typedparser/objects.py +8 -5
- {typedparser-0.12.4 → typedparser-0.13.1}/src/typedparser.egg-info/PKG-INFO +5 -2
- typedparser-0.13.1/src/typedparser.egg-info/requires.txt +8 -0
- typedparser-0.12.4/requirements.txt +0 -2
- typedparser-0.12.4/src/typedparser.egg-info/requires.txt +0 -2
- {typedparser-0.12.4 → typedparser-0.13.1}/LICENSE +0 -0
- {typedparser-0.12.4 → typedparser-0.13.1}/README.md +0 -0
- {typedparser-0.12.4 → typedparser-0.13.1}/setup.cfg +0 -0
- {typedparser-0.12.4 → typedparser-0.13.1}/src/typedparser/_typedattr.py +0 -0
- {typedparser-0.12.4 → typedparser-0.13.1}/src/typedparser/_typedparser.py +0 -0
- {typedparser-0.12.4 → typedparser-0.13.1}/src/typedparser/custom_format.py +0 -0
- {typedparser-0.12.4 → typedparser-0.13.1}/src/typedparser/funcs.py +0 -0
- {typedparser-0.12.4 → typedparser-0.13.1}/src/typedparser.egg-info/SOURCES.txt +0 -0
- {typedparser-0.12.4 → typedparser-0.13.1}/src/typedparser.egg-info/dependency_links.txt +0 -0
- {typedparser-0.12.4 → typedparser-0.13.1}/src/typedparser.egg-info/top_level.txt +0 -0
- {typedparser-0.12.4 → typedparser-0.13.1}/src/typedparser.egg-info/zip-safe +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: typedparser
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.13.1
|
|
4
4
|
Summary: Extension for python argparse with typehints and typechecks.
|
|
5
5
|
Author: simon-ging
|
|
6
6
|
License: Apache-2.0
|
|
@@ -23,7 +23,10 @@ Requires-Python: >=3.7
|
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
License-File: LICENSE
|
|
25
25
|
Requires-Dist: attrs
|
|
26
|
-
Requires-Dist:
|
|
26
|
+
Requires-Dist: importlib_metadata; python_version < "3.8"
|
|
27
|
+
Requires-Dist: typing_extensions; python_version < "3.8"
|
|
28
|
+
Provides-Extra: full
|
|
29
|
+
Requires-Dist: numpy; extra == "full"
|
|
27
30
|
|
|
28
31
|
# typedparser
|
|
29
32
|
|
|
@@ -4,17 +4,20 @@ Generic utilities for python objects
|
|
|
4
4
|
from __future__ import annotations
|
|
5
5
|
|
|
6
6
|
from abc import ABCMeta, abstractmethod
|
|
7
|
+
from attr import has, AttrsInstance
|
|
8
|
+
from attrs import fields
|
|
7
9
|
from collections.abc import Mapping, Iterable
|
|
8
10
|
from copy import deepcopy
|
|
9
11
|
from functools import partial
|
|
10
12
|
from typing import Any, Callable, Type, List
|
|
11
13
|
|
|
12
|
-
import numpy as np
|
|
13
|
-
from attr import has, AttrsInstance
|
|
14
|
-
from attrs import fields
|
|
15
|
-
|
|
16
14
|
AttrsClass = Type[AttrsInstance]
|
|
17
15
|
|
|
16
|
+
try:
|
|
17
|
+
import numpy as np
|
|
18
|
+
except ImportError:
|
|
19
|
+
np = None
|
|
20
|
+
|
|
18
21
|
|
|
19
22
|
def get_attr_names(cls: AttrsClass) -> List[str]:
|
|
20
23
|
"""Get all attribute names of an attrs class."""
|
|
@@ -270,7 +273,7 @@ def _compare_leaf(
|
|
|
270
273
|
d1: Any, d2: Any, _depth: int, rtol=1.0e-5, atol=1.0e-8, equal_nan=False, prefix=""
|
|
271
274
|
) -> List[str]:
|
|
272
275
|
# at this point the 2 leaves are guaranteed to be the same type
|
|
273
|
-
if isinstance(d1, np.ndarray):
|
|
276
|
+
if np is not None and isinstance(d1, np.ndarray):
|
|
274
277
|
comp = np.allclose(d1, d2, rtol=rtol, atol=atol, equal_nan=equal_nan)
|
|
275
278
|
else:
|
|
276
279
|
comp = d1 == d2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: typedparser
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.13.1
|
|
4
4
|
Summary: Extension for python argparse with typehints and typechecks.
|
|
5
5
|
Author: simon-ging
|
|
6
6
|
License: Apache-2.0
|
|
@@ -23,7 +23,10 @@ Requires-Python: >=3.7
|
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
License-File: LICENSE
|
|
25
25
|
Requires-Dist: attrs
|
|
26
|
-
Requires-Dist:
|
|
26
|
+
Requires-Dist: importlib_metadata; python_version < "3.8"
|
|
27
|
+
Requires-Dist: typing_extensions; python_version < "3.8"
|
|
28
|
+
Provides-Extra: full
|
|
29
|
+
Requires-Dist: numpy; extra == "full"
|
|
27
30
|
|
|
28
31
|
# typedparser
|
|
29
32
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|