ladim 2.0.4__tar.gz → 2.0.5__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.
Files changed (44) hide show
  1. {ladim-2.0.4 → ladim-2.0.5}/PKG-INFO +2 -2
  2. {ladim-2.0.4 → ladim-2.0.5}/ladim/__init__.py +1 -1
  3. {ladim-2.0.4 → ladim-2.0.5}/ladim/__main__.py +1 -1
  4. {ladim-2.0.4 → ladim-2.0.5}/ladim/config.py +5 -1
  5. {ladim-2.0.4 → ladim-2.0.5}/ladim/forcing.py +2 -0
  6. {ladim-2.0.4 → ladim-2.0.5}/ladim/grid.py +14 -4
  7. {ladim-2.0.4 → ladim-2.0.5}/ladim/output.py +0 -1
  8. {ladim-2.0.4 → ladim-2.0.5}/ladim.egg-info/PKG-INFO +2 -2
  9. {ladim-2.0.4 → ladim-2.0.5}/tests/test_config.py +5 -1
  10. {ladim-2.0.4 → ladim-2.0.5}/LICENSE +0 -0
  11. {ladim-2.0.4 → ladim-2.0.5}/README.md +0 -0
  12. {ladim-2.0.4 → ladim-2.0.5}/ladim/gridforce/ROMS.py +0 -0
  13. {ladim-2.0.4 → ladim-2.0.5}/ladim/gridforce/__init__.py +0 -0
  14. {ladim-2.0.4 → ladim-2.0.5}/ladim/gridforce/analytical.py +0 -0
  15. {ladim-2.0.4 → ladim-2.0.5}/ladim/gridforce/zROMS.py +0 -0
  16. {ladim-2.0.4 → ladim-2.0.5}/ladim/ibms/__init__.py +0 -0
  17. {ladim-2.0.4 → ladim-2.0.5}/ladim/ibms/light.py +0 -0
  18. {ladim-2.0.4 → ladim-2.0.5}/ladim/main.py +0 -0
  19. {ladim-2.0.4 → ladim-2.0.5}/ladim/model.py +0 -0
  20. {ladim-2.0.4 → ladim-2.0.5}/ladim/plugins/__init__.py +0 -0
  21. {ladim-2.0.4 → ladim-2.0.5}/ladim/release.py +0 -0
  22. {ladim-2.0.4 → ladim-2.0.5}/ladim/sample.py +0 -0
  23. {ladim-2.0.4 → ladim-2.0.5}/ladim/solver.py +0 -0
  24. {ladim-2.0.4 → ladim-2.0.5}/ladim/state.py +0 -0
  25. {ladim-2.0.4 → ladim-2.0.5}/ladim/tracker.py +0 -0
  26. {ladim-2.0.4 → ladim-2.0.5}/ladim/utilities.py +0 -0
  27. {ladim-2.0.4 → ladim-2.0.5}/ladim.egg-info/SOURCES.txt +0 -0
  28. {ladim-2.0.4 → ladim-2.0.5}/ladim.egg-info/dependency_links.txt +0 -0
  29. {ladim-2.0.4 → ladim-2.0.5}/ladim.egg-info/entry_points.txt +0 -0
  30. {ladim-2.0.4 → ladim-2.0.5}/ladim.egg-info/requires.txt +0 -0
  31. {ladim-2.0.4 → ladim-2.0.5}/ladim.egg-info/top_level.txt +0 -0
  32. {ladim-2.0.4 → ladim-2.0.5}/postladim/__init__.py +0 -0
  33. {ladim-2.0.4 → ladim-2.0.5}/postladim/cellcount.py +0 -0
  34. {ladim-2.0.4 → ladim-2.0.5}/postladim/kde_plot.py +0 -0
  35. {ladim-2.0.4 → ladim-2.0.5}/postladim/particlefile.py +0 -0
  36. {ladim-2.0.4 → ladim-2.0.5}/postladim/variable.py +0 -0
  37. {ladim-2.0.4 → ladim-2.0.5}/pyproject.toml +0 -0
  38. {ladim-2.0.4 → ladim-2.0.5}/setup.cfg +0 -0
  39. {ladim-2.0.4 → ladim-2.0.5}/tests/test_forcing.py +0 -0
  40. {ladim-2.0.4 → ladim-2.0.5}/tests/test_ladim.py +0 -0
  41. {ladim-2.0.4 → ladim-2.0.5}/tests/test_model.py +0 -0
  42. {ladim-2.0.4 → ladim-2.0.5}/tests/test_output.py +0 -0
  43. {ladim-2.0.4 → ladim-2.0.5}/tests/test_release.py +0 -0
  44. {ladim-2.0.4 → ladim-2.0.5}/tests/test_solver.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: ladim
3
- Version: 2.0.4
3
+ Version: 2.0.5
4
4
  Summary: Lagrangian Advection and Diffusion Model
5
5
  Home-page: https://github.com/pnsaevik/ladim
6
6
  Author: Bjørn Ådlandsvik
@@ -1,3 +1,3 @@
1
- __version__ = '2.0.4'
1
+ __version__ = '2.0.5'
2
2
 
3
3
  from .main import main, run
@@ -1,2 +1,2 @@
1
1
  from . import run
2
- run()
2
+ run()
@@ -73,7 +73,7 @@ def convert_1_to_2(c):
73
73
  if 'numerics' in c:
74
74
  if 'dt' in c['numerics']:
75
75
  dt_value, dt_unit = c['numerics']['dt']
76
- dt_sec = np.timedelta64(dt_value, dt_unit).astype('timedelta64[s]').astype('int64')
76
+ dt_sec = int(np.timedelta64(dt_value, dt_unit).astype('timedelta64[s]').astype(int))
77
77
 
78
78
  out['version'] = 2
79
79
 
@@ -86,13 +86,17 @@ def convert_1_to_2(c):
86
86
 
87
87
  out['grid'] = {}
88
88
  out['grid']['file'] = dict_get(c, [
89
+ 'gridforce.first_file',
89
90
  'files.grid_file', 'gridforce.grid_file',
90
91
  'files.input_file', 'gridforce.input_file'])
91
92
  out['grid']['legacy_module'] = dict_get(c, 'gridforce.module', '') + '.Grid'
92
93
  out['grid']['start_time'] = np.datetime64(dict_get(c, 'time_control.start_time', '1970'), 's')
94
+ out['grid']['subgrid'] = dict_get(c, 'gridforce.subgrid', None)
93
95
 
94
96
  out['forcing'] = {}
95
97
  out['forcing']['file'] = dict_get(c, ['gridforce.input_file', 'files.input_file'])
98
+ out['forcing']['first_file'] = dict_get(c, 'gridforce.first_file', "")
99
+ out['forcing']['last_file'] = dict_get(c, 'gridforce.last_file', "")
96
100
  out['forcing']['legacy_module'] = dict_get(c, 'gridforce.module', '') + '.Forcing'
97
101
  out['forcing']['start_time'] = np.datetime64(dict_get(c, 'time_control.start_time', '1970'), 's')
98
102
  out['forcing']['stop_time'] = np.datetime64(dict_get(c, 'time_control.stop_time', '1970'), 's')
@@ -45,6 +45,8 @@ class RomsForcing(Forcing):
45
45
  legacy_conf = dict(
46
46
  gridforce=dict(
47
47
  input_file=file,
48
+ first_file=conf.get('first_file', ""),
49
+ last_file=conf.get('last_file', ""),
48
50
  ),
49
51
  ibm_forcing=conf.get('ibm_forcing', []),
50
52
  start_time=conf.get('start_time', None),
@@ -22,18 +22,28 @@ class Grid(Module):
22
22
 
23
23
 
24
24
  class RomsGrid(Grid):
25
- def __init__(self, model: Model, **conf):
25
+ def __init__(
26
+ self,
27
+ model: Model,
28
+ file: str,
29
+ start_time=None,
30
+ subgrid=None,
31
+ legacy_module='ladim.gridforce.ROMS.Grid',
32
+ **_,
33
+ ):
26
34
  super().__init__(model)
27
35
 
28
36
  legacy_conf = dict(
29
37
  gridforce=dict(
30
- input_file=conf['file'],
38
+ input_file=file,
31
39
  ),
32
- start_time=conf.get('start_time', None),
40
+ start_time=start_time,
33
41
  )
42
+ if subgrid is not None:
43
+ legacy_conf['gridforce']['subgrid'] = subgrid
34
44
 
35
45
  from .model import load_class
36
- LegacyGrid = load_class(conf.get('legacy_module', 'ladim.gridforce.ROMS.Grid'))
46
+ LegacyGrid = load_class(legacy_module)
37
47
 
38
48
  # Allow gridforce module in current directory
39
49
  import sys
@@ -242,5 +242,4 @@ def create_netcdf_file(fname: str, formats: dict[str, OutputFormat], diskless=Fa
242
242
  dset.variables[varname].set_auto_mask(False)
243
243
  dset.variables[varname].setncatts(item.attributes)
244
244
 
245
-
246
245
  return dset
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: ladim
3
- Version: 2.0.4
3
+ Version: 2.0.5
4
4
  Summary: Lagrangian Advection and Diffusion Model
5
5
  Home-page: https://github.com/pnsaevik/ladim
6
6
  Author: Bjørn Ådlandsvik
@@ -37,6 +37,8 @@ class Test_convert_1_to_2:
37
37
  'forcing': {
38
38
  'dt': 60,
39
39
  'file': '../forcing*.nc',
40
+ 'first_file': '',
41
+ 'last_file': '',
40
42
  'ibm_forcing': [],
41
43
  'legacy_module': 'ladim.gridforce.ROMS.Forcing',
42
44
  'start_time': np.datetime64('2015-09-07T01:00:00'),
@@ -44,7 +46,9 @@ class Test_convert_1_to_2:
44
46
  'grid': {
45
47
  'file': '../forcing*.nc',
46
48
  'legacy_module': 'ladim.gridforce.ROMS.Grid',
47
- 'start_time': np.datetime64('2015-09-07T01:00:00')},
49
+ 'start_time': np.datetime64('2015-09-07T01:00:00'),
50
+ 'subgrid': None,
51
+ },
48
52
  'ibm': {},
49
53
  'output': {
50
54
  'file': 'out.nc',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes