ncfunc 0.2.1__tar.gz → 0.2.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ncfunc
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Add your description here
5
5
  Author: warmpool
6
6
  Author-email: warmpool <mail@mail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ncfunc"
3
- version = "0.2.1"
3
+ version = "0.2.2"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ncfunc"
3
- version = "0.2.1"
3
+ version = "0.2.2"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -966,7 +966,7 @@ def save(
966
966
  msg = f"cannot cast data of '{name}' to a numpy array"
967
967
  raise ValueError(msg) from e
968
968
 
969
- # ---- data check - is ndim(dim) == 1?
969
+ # ---- data check
970
970
  for i, (name, value) in enumerate(arrays.items()):
971
971
  if (
972
972
  (len(arrays) == 1 and i == 0) # the only entry (variable == dimension)
@@ -982,6 +982,13 @@ def save(
982
982
  f"I'm not going to help you write an empty data of shape={value.shape} to {name=}"
983
983
  )
984
984
 
985
+ if len(arrays) > 1:
986
+ shapes = tuple(v.shape for v in arrays.values())
987
+ var_shape = shapes[0]
988
+ dim_shape = tuple(s[0] for s in shapes[1:])
989
+ if var_shape != dim_shape:
990
+ raise ValueError(f"shapes differ: {var_shape=} {dim_shape=}")
991
+
985
992
  # ---- assign parameters to create and write functions
986
993
  names = tuple(data.keys())
987
994
 
File without changes
File without changes
File without changes