nfdata 0.1.0__tar.gz → 0.2.0__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.
nfdata-0.2.0/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024, UK Centre for Ecology & Hydrology
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: nfdata
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Compile and edit input data for the NanoFASE model
5
5
  License: BSD-3-Clause
6
6
  Author: Sam Harrison
@@ -10,10 +10,12 @@ Classifier: License :: OSI Approved :: BSD License
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.10
12
12
  Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
13
15
  Requires-Dist: Pint (>=0.24.1,<0.25.0)
14
16
  Requires-Dist: f90nml (>=1.4.4,<2.0.0)
15
17
  Requires-Dist: geopandas (>=1.0.0,<2.0.0)
16
- Requires-Dist: netCDF4 (>=1.7.1.post1,<2.0.0)
18
+ Requires-Dist: netcdf4 (>=1.7.1.post1,<2.0.0)
17
19
  Requires-Dist: numpy (>=2.0.0,<3.0.0)
18
20
  Requires-Dist: pandas (>=2.2.2,<3.0.0)
19
21
  Requires-Dist: rasterio (>=1.3.10,<2.0.0)
@@ -28,23 +30,41 @@ The NanoFASE Data module is a set of scripts to compile and edit input data for
28
30
 
29
31
  [See the NanoFASE documentation for full documentation](https://nerc-ceh.github.io/nanofase/users/nanofase-data.html).
30
32
 
31
- *Still in development. Use with caution!*
32
-
33
33
  ## Getting started
34
34
 
35
- The easiest way to get started is to create a Conda environment using the provided [environment.yaml](./environment.yaml) file:
35
+ The package is available on [PyPI](https://pypi.org/project/nfdata/) or [Conda](https://anaconda.org/samharrison7/nfdata), and the easiest way to use the package is to install one of these using Pixi, Conda/Mamba or Pip.
36
+
37
+ Conda:
38
+
39
+ ```console
40
+ $ conda install -c samharrison7 nfdata
41
+ ```
42
+
43
+ Mamba:
44
+ ```console
45
+ $ mamba install -c samharrison7 nfdata
46
+ ```
36
47
 
37
- ```shell script
38
- $ conda env create -f environment.yaml
39
- $ activate nanofase-data
48
+ Pip:
49
+ ```console
50
+ $ pip install nfdata
40
51
  ```
41
52
 
42
- If you don't want to use Conda, then this [environment.yaml](./environment.yaml) file lists the packages that need to be installed.
53
+ Pixi (global):
54
+ ```console
55
+ $ pixi global install -c samharrison7 nfdata
56
+ ```
57
+
58
+ Pixi (project):
59
+ ```console
60
+ $ pixi project channel add samharrison7
61
+ $ pixi add nfdata
62
+ ```
43
63
 
44
64
  ## Usage
45
65
 
46
66
  ```
47
- usage: nanofase_data.py [-h] [--output OUTPUT] {create,edit,constants} file
67
+ usage: nfdata [-h] [--output OUTPUT] {create,edit,constants} file
48
68
 
49
69
  Compile or edit data for the NanoFASE model.
50
70
 
@@ -66,8 +86,8 @@ optional arguments:
66
86
 
67
87
  Specifying the "create" option compiles a new NetCDF dataset and Fortran namelist constant file:
68
88
 
69
- ```shell script
70
- $ python nanofase_data.py create /path/to/config.create.yaml
89
+ ```console
90
+ $ nfdata create /path/to/config.create.yaml
71
91
  ```
72
92
 
73
93
  An annotated example config file is given: [`config.create.example.yaml`](config.create.example.yaml). The file is quite self-explanatory, but a few further explanations are provided in [this document](docs/config.md).
@@ -78,8 +98,8 @@ The two files will be output to the paths specified in the config file.
78
98
 
79
99
  To edit an existing NetCDF dataset, specify the "edit" option:
80
100
 
81
- ```shell script
82
- $ python nanofase_data.py edit /path/to/config.edit.yaml
101
+ ```console
102
+ $ nfdata edit /path/to/config.edit.yaml
83
103
  ```
84
104
 
85
105
  An annotated example config file is given: [`config.edit.example.yaml`](config.edit.example.yaml). This is similar (but not identical) in format to the creation config file, except only those variables you with to edit should be specified (all other variables are left as-is).
@@ -92,8 +112,8 @@ The Fortran namelist file cannot be edited using this method and you should inst
92
112
 
93
113
  To simply convert a constants YAML file to a Fortran namelist file, you can use the `constants` option:
94
114
 
95
- ```shell script
96
- $ python nanofase_data.py constants /path/to/constants.yaml -o /path/to/constants.nml
115
+ ```console
116
+ $ nfdata constants /path/to/constants.yaml -o /path/to/constants.nml
97
117
  ```
98
118
 
99
119
  No config file is required. The location of the newly created constants file is given by the `-o` or `--output` argument.
@@ -102,3 +122,4 @@ No config file is required. The location of the newly created constants file is
102
122
  - For the moment, all rasters must be the same CRS as the `flow_dir` raster, and this must be a projected raster. We recommend ESPG:27700 (British National Grid). In addition, all rasters except for `land_use` must be the same resolution as `flow_dir`. They can cover a large geographical region and the module will automatically clip them to the correct size.
103
123
  - Support for different file types is a bit sporadic at the moment. I suggest sticking the raster files for spatial variables, raster or CSV files for spatiotemporal variables (with 1 file per timestep for raster files) and shapefiles for point sources. You will trigger errors if you use an unsupported file.
104
124
  - Example input data files are given in `data.example/thames_tio2_2015/`. Running the model using the example config files uses these data.
125
+
@@ -4,23 +4,41 @@ The NanoFASE Data module is a set of scripts to compile and edit input data for
4
4
 
5
5
  [See the NanoFASE documentation for full documentation](https://nerc-ceh.github.io/nanofase/users/nanofase-data.html).
6
6
 
7
- *Still in development. Use with caution!*
8
-
9
7
  ## Getting started
10
8
 
11
- The easiest way to get started is to create a Conda environment using the provided [environment.yaml](./environment.yaml) file:
9
+ The package is available on [PyPI](https://pypi.org/project/nfdata/) or [Conda](https://anaconda.org/samharrison7/nfdata), and the easiest way to use the package is to install one of these using Pixi, Conda/Mamba or Pip.
10
+
11
+ Conda:
12
12
 
13
- ```shell script
14
- $ conda env create -f environment.yaml
15
- $ activate nanofase-data
13
+ ```console
14
+ $ conda install -c samharrison7 nfdata
16
15
  ```
17
16
 
18
- If you don't want to use Conda, then this [environment.yaml](./environment.yaml) file lists the packages that need to be installed.
17
+ Mamba:
18
+ ```console
19
+ $ mamba install -c samharrison7 nfdata
20
+ ```
21
+
22
+ Pip:
23
+ ```console
24
+ $ pip install nfdata
25
+ ```
26
+
27
+ Pixi (global):
28
+ ```console
29
+ $ pixi global install -c samharrison7 nfdata
30
+ ```
31
+
32
+ Pixi (project):
33
+ ```console
34
+ $ pixi project channel add samharrison7
35
+ $ pixi add nfdata
36
+ ```
19
37
 
20
38
  ## Usage
21
39
 
22
40
  ```
23
- usage: nanofase_data.py [-h] [--output OUTPUT] {create,edit,constants} file
41
+ usage: nfdata [-h] [--output OUTPUT] {create,edit,constants} file
24
42
 
25
43
  Compile or edit data for the NanoFASE model.
26
44
 
@@ -42,8 +60,8 @@ optional arguments:
42
60
 
43
61
  Specifying the "create" option compiles a new NetCDF dataset and Fortran namelist constant file:
44
62
 
45
- ```shell script
46
- $ python nanofase_data.py create /path/to/config.create.yaml
63
+ ```console
64
+ $ nfdata create /path/to/config.create.yaml
47
65
  ```
48
66
 
49
67
  An annotated example config file is given: [`config.create.example.yaml`](config.create.example.yaml). The file is quite self-explanatory, but a few further explanations are provided in [this document](docs/config.md).
@@ -54,8 +72,8 @@ The two files will be output to the paths specified in the config file.
54
72
 
55
73
  To edit an existing NetCDF dataset, specify the "edit" option:
56
74
 
57
- ```shell script
58
- $ python nanofase_data.py edit /path/to/config.edit.yaml
75
+ ```console
76
+ $ nfdata edit /path/to/config.edit.yaml
59
77
  ```
60
78
 
61
79
  An annotated example config file is given: [`config.edit.example.yaml`](config.edit.example.yaml). This is similar (but not identical) in format to the creation config file, except only those variables you with to edit should be specified (all other variables are left as-is).
@@ -68,8 +86,8 @@ The Fortran namelist file cannot be edited using this method and you should inst
68
86
 
69
87
  To simply convert a constants YAML file to a Fortran namelist file, you can use the `constants` option:
70
88
 
71
- ```shell script
72
- $ python nanofase_data.py constants /path/to/constants.yaml -o /path/to/constants.nml
89
+ ```console
90
+ $ nfdata constants /path/to/constants.yaml -o /path/to/constants.nml
73
91
  ```
74
92
 
75
93
  No config file is required. The location of the newly created constants file is given by the `-o` or `--output` argument.
@@ -77,4 +95,4 @@ No config file is required. The location of the newly created constants file is
77
95
  ### Tips
78
96
  - For the moment, all rasters must be the same CRS as the `flow_dir` raster, and this must be a projected raster. We recommend ESPG:27700 (British National Grid). In addition, all rasters except for `land_use` must be the same resolution as `flow_dir`. They can cover a large geographical region and the module will automatically clip them to the correct size.
79
97
  - Support for different file types is a bit sporadic at the moment. I suggest sticking the raster files for spatial variables, raster or CSV files for spatiotemporal variables (with 1 file per timestep for raster files) and shapefiles for point sources. You will trigger errors if you use an unsupported file.
80
- - Example input data files are given in `data.example/thames_tio2_2015/`. Running the model using the example config files uses these data.
98
+ - Example input data files are given in `data.example/thames_tio2_2015/`. Running the model using the example config files uses these data.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "nfdata"
3
- version = "0.1.0"
3
+ version = "0.2.0"
4
4
  description = "Compile and edit input data for the NanoFASE model"
5
5
  authors = ["Sam Harrison <samharrison.xg@gmail.com>"]
6
6
  license = "BSD-3-Clause"
@@ -20,7 +20,7 @@ pandas = "^2.2.2"
20
20
  geopandas = "^1.0.0"
21
21
  rasterio = "^1.3.10"
22
22
  "ruamel.yaml" = "^0.18.6"
23
- netCDF4 = "^1.7.1.post1"
23
+ netcdf4 = "^1.7.1.post1"
24
24
  shapely = "^2.0.4"
25
25
  Pint = "^0.24.1"
26
26
  f90nml = "^1.4.4"
nfdata-0.1.0/setup.py DELETED
@@ -1,46 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- from setuptools import setup
3
-
4
- package_dir = \
5
- {'': 'src'}
6
-
7
- packages = \
8
- ['nfdata']
9
-
10
- package_data = \
11
- {'': ['*']}
12
-
13
- install_requires = \
14
- ['Pint>=0.24.1,<0.25.0',
15
- 'f90nml>=1.4.4,<2.0.0',
16
- 'geopandas>=1.0.0,<2.0.0',
17
- 'netCDF4>=1.7.1.post1,<2.0.0',
18
- 'numpy>=2.0.0,<3.0.0',
19
- 'pandas>=2.2.2,<3.0.0',
20
- 'rasterio>=1.3.10,<2.0.0',
21
- 'ruamel.yaml>=0.18.6,<0.19.0',
22
- 'shapely>=2.0.4,<3.0.0']
23
-
24
- entry_points = \
25
- {'console_scripts': ['nfdata = nfdata.console:run']}
26
-
27
- setup_kwargs = {
28
- 'name': 'nfdata',
29
- 'version': '0.1.0',
30
- 'description': 'Compile and edit input data for the NanoFASE model',
31
- 'long_description': '# NanoFASE Data\n\nThe NanoFASE Data module is a set of scripts to compile and edit input data for the [NanoFASE model](https://github.com/nerc-ceh/nanofase).\n\n[See the NanoFASE documentation for full documentation](https://nerc-ceh.github.io/nanofase/users/nanofase-data.html).\n\n*Still in development. Use with caution!*\n\n## Getting started\n\nThe easiest way to get started is to create a Conda environment using the provided [environment.yaml](./environment.yaml) file:\n\n```shell script\n$ conda env create -f environment.yaml\n$ activate nanofase-data\n```\n\nIf you don\'t want to use Conda, then this [environment.yaml](./environment.yaml) file lists the packages that need to be installed.\n\n## Usage\n\n```\nusage: nanofase_data.py [-h] [--output OUTPUT] {create,edit,constants} file\n\nCompile or edit data for the NanoFASE model.\n\npositional arguments:\n {create,edit,constants}\n do you wish to create from scratch, edit the data or\n create a constants file?\n file path to the config file (create/edit tasks) or\n constants file (constants task)\n\noptional arguments:\n -h, --help show this help message and exit\n --output OUTPUT, -o OUTPUT\n where to create the new constants file (for constants\n task)\n```\n\n### Creating a new dataset\n\nSpecifying the "create" option compiles a new NetCDF dataset and Fortran namelist constant file:\n\n```shell script\n$ python nanofase_data.py create /path/to/config.create.yaml\n```\n\nAn annotated example config file is given: [`config.create.example.yaml`](config.create.example.yaml). The file is quite self-explanatory, but a few further explanations are provided in [this document](docs/config.md).\n\nThe two files will be output to the paths specified in the config file.\n\n### Editing an existing dataset\n\nTo edit an existing NetCDF dataset, specify the "edit" option:\n\n```shell script\n$ python nanofase_data.py edit /path/to/config.edit.yaml\n```\n\nAn annotated example config file is given: [`config.edit.example.yaml`](config.edit.example.yaml). This is similar (but not identical) in format to the creation config file, except only those variables you with to edit should be specified (all other variables are left as-is).\n\nCertain variables can\'t be edited: `flow_dir`, `is_estuary`. Create a new dataset instead if you wish to change these variables.\n\nThe Fortran namelist file cannot be edited using this method and you should instead edit the file directly.\n\n### Only creating a new constants file\n\nTo simply convert a constants YAML file to a Fortran namelist file, you can use the `constants` option:\n\n```shell script\n$ python nanofase_data.py constants /path/to/constants.yaml -o /path/to/constants.nml\n```\n\nNo config file is required. The location of the newly created constants file is given by the `-o` or `--output` argument.\n\n### Tips\n- For the moment, all rasters must be the same CRS as the `flow_dir` raster, and this must be a projected raster. We recommend ESPG:27700 (British National Grid). In addition, all rasters except for `land_use` must be the same resolution as `flow_dir`. They can cover a large geographical region and the module will automatically clip them to the correct size.\n- Support for different file types is a bit sporadic at the moment. I suggest sticking the raster files for spatial variables, raster or CSV files for spatiotemporal variables (with 1 file per timestep for raster files) and shapefiles for point sources. You will trigger errors if you use an unsupported file.\n- Example input data files are given in `data.example/thames_tio2_2015/`. Running the model using the example config files uses these data. ',
32
- 'author': 'Sam Harrison',
33
- 'author_email': 'samharrison.xg@gmail.com',
34
- 'maintainer': 'None',
35
- 'maintainer_email': 'None',
36
- 'url': 'None',
37
- 'package_dir': package_dir,
38
- 'packages': packages,
39
- 'package_data': package_data,
40
- 'install_requires': install_requires,
41
- 'entry_points': entry_points,
42
- 'python_requires': '>=3.10,<4.0',
43
- }
44
-
45
-
46
- setup(**setup_kwargs)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes