Skip to content

Commit

Permalink
Merge pull request #44 from rhayes777/feature/numpy_310_fix
Browse files Browse the repository at this point in the history
use builtin not numpy alias
  • Loading branch information
Jammy2211 authored Oct 16, 2023
2 parents e92a599 + 3a9f98f commit 38aab51
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, '3.10']
python-version: [3.8, 3.9, '3.10', '3.11']
steps:
- name: Checkout PyAutoConf
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion autoconf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
from .json_prior.config import path_for_class
from .json_prior.config import JSONPriorConfig

__version__ = "2023.7.5.2"
__version__ = "2023.9.18.4"
8 changes: 7 additions & 1 deletion autoconf/dictable.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@
logger = logging.getLogger(__name__)


np_type_map = {
"bool": "bool_",
}


def nd_array_as_dict(obj: np.ndarray) -> dict:
"""
Converts a numpy array to a dictionary representation.
"""
np_type = str(obj.dtype)
return {
"type": "ndarray",
"array": obj.tolist(),
"dtype": str(obj.dtype),
"dtype": np_type_map.get(np_type, np_type),
}


Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
typing-inspect>=0.4.0
pathlib
PyYAML>=6.0.1
numpy<=1.23.5
numpy<=1.26.0

0 comments on commit 38aab51

Please sign in to comment.