ncfunc 0.2.0__tar.gz → 0.2.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.
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ncfunc
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Add your description here
5
5
  Author: warmpool
6
6
  Author-email: warmpool <mail@mail.com>
7
7
  Requires-Dist: datenum>=0.1.0
8
- Requires-Dist: netcdf4>=1.7.3
8
+ Requires-Dist: netcdf4>=1.6
9
9
  Requires-Dist: numpy>=1.24
10
10
  Requires-Python: >=3.10
11
11
  Project-URL: Homepage, https://github.com/warmpool/py-ncfunc
@@ -1,12 +1,12 @@
1
1
  [project]
2
2
  name = "ncfunc"
3
- version = "0.2.0"
3
+ version = "0.2.1"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
7
7
  dependencies = [
8
8
  "datenum>=0.1.0",
9
- "netcdf4>=1.7.3",
9
+ "netcdf4>=1.6",
10
10
  "numpy>=1.24",
11
11
  ]
12
12
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ncfunc"
3
- version = "0.2.0"
3
+ version = "0.2.1"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -9,7 +9,7 @@ authors = [
9
9
  requires-python = ">=3.10"
10
10
  dependencies = [
11
11
  "datenum>=0.1.0",
12
- "netcdf4>=1.7.3",
12
+ "netcdf4>=1.6",
13
13
  "numpy>=1.24",
14
14
  ]
15
15
 
@@ -723,11 +723,14 @@ def write_attr(path: PathLike, var_name: str, attr_name: str, value: Any) -> Non
723
723
  the file if var_name == '/'
724
724
  the variable else
725
725
 
726
- raises KeyError if the variable does not exist, FileNotFoundError if
727
- the path does not exist
726
+ only a root write creates the file when the path does not exist; a variable
727
+ write raises FileNotFoundError instead, leaving no file behind.
728
+
729
+ raises KeyError if the variable does not exist
728
730
  """
729
- # check var_name here; KeyError and FileNotFoundError surface from here
730
- _get_variable_meta(path, var_name)
731
+ if var_name != "/": # check var_name here; KeyError and FileNotFoundError surface
732
+ _get_variable_meta(path, var_name)
733
+
731
734
  with nc.Dataset(path, "a") as h_file:
732
735
  if var_name == "/":
733
736
  h_file.setncattr(attr_name, value)
File without changes
File without changes
File without changes