ncftools 0.9.0__tar.gz → 0.9.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.4
2
2
  Name: ncftools
3
- Version: 0.9.0
3
+ Version: 0.9.2
4
4
  Summary: A collection of tools for working with NetCDF files
5
5
  Author-email: aaronchh <aaronhsu219@gmail.com>
6
6
  License-Expression: MIT
@@ -52,7 +52,7 @@ ncftools-info
52
52
  Display mesh information from a FlowFM NetCDF file.
53
53
 
54
54
  ```bash
55
- meshinfo -i FlowFM_net.nc
55
+ meshinfo FlowFM_net.nc
56
56
  meshinfo -h
57
57
  ```
58
58
 
@@ -36,7 +36,7 @@ ncftools-info
36
36
  Display mesh information from a FlowFM NetCDF file.
37
37
 
38
38
  ```bash
39
- meshinfo -i FlowFM_net.nc
39
+ meshinfo FlowFM_net.nc
40
40
  meshinfo -h
41
41
  ```
42
42
 
@@ -2,7 +2,7 @@
2
2
  NCFTOOLS - A collection of tools for working with NetCDF files.
3
3
  """
4
4
 
5
- __version__ = '0.9.0'
5
+ __version__ = '0.9.2'
6
6
 
7
7
  __all__ = [
8
8
  'meshinfo',
@@ -15,8 +15,8 @@ TOOL_DESCRIPTIONS = {
15
15
  quadrilaterals), and the spatial extent of the mesh.
16
16
 
17
17
  Examples:
18
- meshinfo -i FlowFM_net.nc # Display mesh info for a given file
19
- meshinfo -i grid.nc # Any FlowFM mesh NetCDF file
18
+ meshinfo FlowFM_net.nc # Display mesh info for a given file
19
+ meshinfo grid.nc # Any FlowFM mesh NetCDF file
20
20
  """,
21
21
  'nc2shp': """
22
22
  Convert a NetCDF mesh file to ESRI Shapefiles.
@@ -63,8 +63,9 @@ def main():
63
63
  formatter_class=argparse.RawDescriptionHelpFormatter,
64
64
  epilog="""
65
65
  Examples:
66
- meshinfo -i FlowFM_net.nc # Specify a NetCDF mesh file
67
- meshinfo -i grid.nc # Use any FlowFM mesh file
66
+ meshinfo # Use default FlowFM_net.nc
67
+ meshinfo grid.nc # Use any FlowFM mesh file
68
+ meshinfo -i grid.nc # Same, with the -i flag
68
69
  meshinfo -h # Show this help message
69
70
 
70
71
  The tool displays:
@@ -74,15 +75,24 @@ The tool displays:
74
75
  """,
75
76
  )
76
77
 
78
+ parser.add_argument(
79
+ 'file',
80
+ nargs='?',
81
+ metavar='FILE',
82
+ help='Path to the FlowFM NetCDF mesh file (default: FlowFM_net.nc)',
83
+ )
77
84
  parser.add_argument(
78
85
  '-i', '--input',
79
- required=True,
80
86
  metavar='FILE',
81
- help='Path to the FlowFM NetCDF mesh file',
87
+ help='Same as FILE (kept for backward compatibility)',
82
88
  )
83
89
 
84
90
  args = parser.parse_args()
85
91
 
92
+ if args.file and args.input:
93
+ parser.error('give the mesh file either as FILE or with -i, not both')
94
+ args.input = args.file or args.input or 'FlowFM_net.nc'
95
+
86
96
  if not os.path.isfile(args.input):
87
97
  print(f"Error: File '{args.input}' not found.")
88
98
  print(f"Current directory: {os.getcwd()}")
@@ -226,7 +226,7 @@ def main():
226
226
  epilog="""
227
227
  Examples:
228
228
  nc2shp -i FlowFM_net.nc
229
- nc2shp -i mesh.nc -d
229
+ nc2shp -i mesh.nc -d # also write the dissolved polygon
230
230
  nc2shp -i mesh.nc -o output --crs EPSG:4326
231
231
  nc2shp -i mesh.nc -q
232
232
  """,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ncftools
3
- Version: 0.9.0
3
+ Version: 0.9.2
4
4
  Summary: A collection of tools for working with NetCDF files
5
5
  Author-email: aaronchh <aaronhsu219@gmail.com>
6
6
  License-Expression: MIT
@@ -52,7 +52,7 @@ ncftools-info
52
52
  Display mesh information from a FlowFM NetCDF file.
53
53
 
54
54
  ```bash
55
- meshinfo -i FlowFM_net.nc
55
+ meshinfo FlowFM_net.nc
56
56
  meshinfo -h
57
57
  ```
58
58
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ncftools"
7
- version = "0.9.0"
7
+ version = "0.9.2"
8
8
  authors = [
9
9
  { name = "aaronchh", email = "aaronhsu219@gmail.com" },
10
10
  ]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes