rompy 0.3.0__tar.gz → 0.4.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.
- {rompy-0.3.0/rompy.egg-info → rompy-0.4.0}/PKG-INFO +5 -4
- rompy-0.4.0/docs/source/cli.rst +124 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/core_concepts.rst +6 -1
- rompy-0.4.0/docs/source/formatting_and_logging.rst +216 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/index.rst +3 -1
- rompy-0.4.0/docs/source/schism/boundary_conditions.rst +712 -0
- rompy-0.4.0/docs/source/schism/hotstart.rst +394 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/schism/index.rst +33 -3
- rompy-0.4.0/notebooks/schism/boundary_conditions_examples/01_tidal_only/basic_tidal.yaml +51 -0
- rompy-0.4.0/notebooks/schism/boundary_conditions_examples/01_tidal_only/extended_tidal.yaml +52 -0
- rompy-0.4.0/notebooks/schism/boundary_conditions_examples/01_tidal_only/tidal_with_mdt.yaml +63 -0
- rompy-0.4.0/notebooks/schism/boundary_conditions_examples/01_tidal_only/tidal_with_mdt_const.yaml +52 -0
- rompy-0.4.0/notebooks/schism/boundary_conditions_examples/01_tidal_only/tidal_with_potential.yaml +53 -0
- rompy-0.4.0/notebooks/schism/boundary_conditions_examples/01_tidal_only/tide_wave.yaml +89 -0
- rompy-0.4.0/notebooks/schism/boundary_conditions_examples/02_hybrid/full_hybrid.yaml +143 -0
- rompy-0.4.0/notebooks/schism/boundary_conditions_examples/02_hybrid/hybrid_elevation.yaml +91 -0
- rompy-0.4.0/notebooks/schism/boundary_conditions_examples/03_river/multi_river.yaml +109 -0
- rompy-0.4.0/notebooks/schism/boundary_conditions_examples/03_river/simple_river.yaml +93 -0
- rompy-0.4.0/notebooks/schism/boundary_conditions_examples/04_nested/nested_with_tides.yaml +137 -0
- rompy-0.4.0/notebooks/schism/boundary_conditions_examples/05_advanced/mixed_boundaries.yaml +179 -0
- rompy-0.4.0/notebooks/schism/demo_nml.yaml +81 -0
- rompy-0.4.0/notebooks/schism/demo_nml_3d_lsc2.yaml +85 -0
- rompy-0.4.0/notebooks/schism/demo_nml_3d_lsc2_enhanced.yaml +98 -0
- rompy-0.4.0/notebooks/schism/demo_nml_3d_nontidal_velocities.yaml +147 -0
- rompy-0.4.0/notebooks/schism/demo_nml_3d_nontidal_velocities_enhanced.yaml +139 -0
- rompy-0.4.0/notebooks/schism/demo_nml_3d_tidal_velocities.yaml +123 -0
- rompy-0.4.0/notebooks/schism/demo_nml_3d_tidal_velocities_enhanced.yaml +123 -0
- rompy-0.4.0/notebooks/schism/demo_nml_enhanced.yaml +83 -0
- rompy-0.4.0/notebooks/schism/demo_tides_only.yaml +73 -0
- {rompy-0.3.0 → rompy-0.4.0}/pyproject.toml +4 -4
- rompy-0.4.0/rompy/__init__.py +38 -0
- rompy-0.4.0/rompy/cli.py +256 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/core/boundary.py +6 -1
- {rompy-0.3.0 → rompy-0.4.0}/rompy/core/config.py +1 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/core/data.py +0 -1
- {rompy-0.3.0 → rompy-0.4.0}/rompy/core/grid.py +1 -1
- rompy-0.4.0/rompy/core/logging/__init__.py +63 -0
- rompy-0.4.0/rompy/core/logging/config.py +201 -0
- rompy-0.4.0/rompy/core/logging/formatter.py +284 -0
- rompy-0.4.0/rompy/core/logging/logger.py +144 -0
- rompy-0.4.0/rompy/core/render.py +227 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/core/source.py +19 -5
- {rompy-0.3.0 → rompy-0.4.0}/rompy/core/time.py +34 -2
- {rompy-0.3.0 → rompy-0.4.0}/rompy/core/types.py +105 -7
- rompy-0.4.0/rompy/formatting.py +516 -0
- rompy-0.4.0/rompy/model.py +299 -0
- rompy-0.4.0/rompy/schism/__init__.py +17 -0
- rompy-0.4.0/rompy/schism/bctides.py +800 -0
- rompy-0.4.0/rompy/schism/boundary.py +303 -0
- rompy-0.4.0/rompy/schism/boundary_conditions.py +87 -0
- rompy-0.4.0/rompy/schism/boundary_core.py +1417 -0
- rompy-0.4.0/rompy/schism/config.py +144 -0
- rompy-0.3.0/rompy/schism/config.py → rompy-0.4.0/rompy/schism/config_legacy.py +144 -209
- rompy-0.4.0/rompy/schism/config_plotting.py +533 -0
- rompy-0.4.0/rompy/schism/config_plotting_boundary.py +437 -0
- rompy-0.4.0/rompy/schism/config_plotting_tides.py +776 -0
- rompy-0.4.0/rompy/schism/data.py +1637 -0
- rompy-0.4.0/rompy/schism/grid.py +1091 -0
- rompy-0.4.0/rompy/schism/hotstart.py +535 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/basemodel.py +26 -7
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/claude_full/sediment.py +9 -3
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/param.py +119 -21
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/sample_inputs/create_model.py +1 -1
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/schism.py +14 -9
- rompy-0.4.0/rompy/schism/numpy_types.py +74 -0
- rompy-0.4.0/rompy/schism/tides_enhanced.py +768 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/utils.py +23 -12
- rompy-0.4.0/rompy/schism/vgrid.py +176 -0
- rompy-0.4.0/rompy/swan/__init__.py +26 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/boundary.py +19 -14
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/components/base.py +11 -10
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/components/group.py +60 -62
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/components/lockup.py +13 -8
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/components/numerics.py +16 -11
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/components/output.py +14 -9
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/components/physics.py +23 -17
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/components/startup.py +10 -5
- rompy-0.4.0/rompy/swan/config.py +698 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/data.py +161 -14
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/grid.py +10 -4
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/interface.py +8 -4
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/legacy.py +8 -3
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/subcomponents/base.py +10 -2
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/subcomponents/boundary.py +11 -6
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/subcomponents/output.py +7 -1
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/subcomponents/readgrid.py +11 -7
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/subcomponents/time.py +10 -5
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/types.py +10 -1
- {rompy-0.3.0 → rompy-0.4.0}/rompy/utils.py +12 -12
- {rompy-0.3.0 → rompy-0.4.0/rompy.egg-info}/PKG-INFO +5 -4
- {rompy-0.3.0 → rompy-0.4.0}/rompy.egg-info/SOURCES.txt +97 -50
- {rompy-0.3.0 → rompy-0.4.0}/rompy.egg-info/entry_points.txt +0 -1
- {rompy-0.3.0 → rompy-0.4.0}/rompy.egg-info/requires.txt +4 -3
- {rompy-0.3.0 → rompy-0.4.0}/rompy.egg-info/top_level.txt +1 -0
- rompy-0.4.0/tests/core/test_logging.py +218 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/example_configs/make_full_yaml.py +7 -0
- rompy-0.4.0/tests/schism/__init__.py +1 -0
- rompy-0.4.0/tests/schism/conftest.py +199 -0
- rompy-0.4.0/tests/schism/functional/test_model_setup.py +170 -0
- rompy-0.4.0/tests/schism/integration/test_namelist.py +168 -0
- rompy-0.4.0/tests/schism/integration/test_workflows.py +146 -0
- rompy-0.4.0/tests/schism/simple_bctides_test.py +115 -0
- rompy-0.4.0/tests/schism/test_bctides_format_simple.py +255 -0
- rompy-0.4.0/tests/schism/test_bctides_standalone.py +313 -0
- rompy-0.4.0/tests/schism/test_boundary_conditions.py +442 -0
- rompy-0.4.0/tests/schism/test_boundary_plotting.py +213 -0
- rompy-0.4.0/tests/schism/test_boundary_plotting_updated.py +230 -0
- rompy-0.4.0/tests/schism/test_compare_gr3_generation.py +110 -0
- rompy-0.4.0/tests/schism/test_enhanced_tidal_boundary.py +745 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/schism/test_grid.py +54 -3
- rompy-0.4.0/tests/schism/test_hotstart.py +180 -0
- rompy-0.4.0/tests/schism/test_hotstart_integration.py +505 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/schism/test_namelists.py +9 -2
- {rompy-0.3.0 → rompy-0.4.0}/tests/schism/test_nml.py +7 -0
- rompy-0.4.0/tests/schism/test_pylibs_boundaries.py +161 -0
- rompy-0.4.0/tests/schism/test_pylibs_boundaries_expanded.py +161 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/schism/test_schism_csiro.py +10 -3
- rompy-0.4.0/tests/schism/test_schism_data.py +173 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/schism/test_schism_nml.py +8 -1
- rompy-0.4.0/tests/schism/test_sflux_plotting.py +284 -0
- rompy-0.4.0/tests/schism/test_tidal_boundary_consistency.py +300 -0
- rompy-0.4.0/tests/schism/test_vgridgenerators.py +39 -0
- rompy-0.4.0/tests/schism/test_visualization.py +538 -0
- rompy-0.4.0/tests/schism/unit/test_boundary_tides.py +310 -0
- rompy-0.4.0/tests/schism/unit/test_grid.py +144 -0
- rompy-0.4.0/tests/schism/unit/test_schism_boundary.py +115 -0
- rompy-0.4.0/tests/schism/unit/test_tides_enhanced.py +342 -0
- rompy-0.4.0/tests/schism/unit/test_vgrid.py +97 -0
- rompy-0.4.0/tests/schism/utils_pylibs.py +72 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/swan/components/test_base.py +7 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/swan/components/test_boundary.py +6 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/swan/components/test_cgrid.py +6 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/swan/components/test_inpgrid.py +8 -4
- {rompy-0.3.0 → rompy-0.4.0}/tests/swan/components/test_lockup.py +7 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/swan/components/test_output.py +7 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/swan/components/test_physics.py +6 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/swan/components/test_startup.py +7 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/swan/subcomponents/test_subcomponent_boundary.py +6 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/swan/subcomponents/test_subcomponent_physics.py +5 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/swan/subcomponents/test_subcomponent_readgrid.py +6 -3
- {rompy-0.3.0 → rompy-0.4.0}/tests/swan/subcomponents/test_subcomponent_shape.py +7 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/swan/subcomponents/test_subcomponent_time.py +7 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/swan/test_swan_config.py +7 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/swan/test_swan_model.py +5 -1
- {rompy-0.3.0 → rompy-0.4.0}/tests/swan/test_swan_types.py +7 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/test_basegrid.py +7 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/test_basemodel.py +8 -1
- {rompy-0.3.0 → rompy-0.4.0}/tests/test_data.py +7 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/test_intake_driver.py +7 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/test_serilization.py +7 -0
- rompy-0.4.0/tests/test_swan_data_formatting.py +201 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/test_swanbasic.py +7 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/test_swanboundary.py +7 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/test_swandata.py +8 -1
- {rompy-0.3.0 → rompy-0.4.0}/tests/test_swangrid.py +7 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/test_swanmodel.py +8 -1
- {rompy-0.3.0 → rompy-0.4.0}/tests/test_swantemplate.py +8 -1
- {rompy-0.3.0 → rompy-0.4.0}/tests/test_templates.py +8 -1
- {rompy-0.3.0 → rompy-0.4.0}/tests/test_time.py +20 -13
- rompy-0.4.0/tests/test_utils/__init__.py +9 -0
- rompy-0.4.0/tests/test_utils/logging.py +89 -0
- rompy-0.4.0/tests/utils/__init__.py +23 -0
- rompy-0.4.0/tests/utils/compare.py +77 -0
- rompy-0.4.0/tests/utils/schism.py +65 -0
- rompy-0.3.0/rompy/__init__.py +0 -20
- rompy-0.3.0/rompy/cli.py +0 -55
- rompy-0.3.0/rompy/core/render.py +0 -78
- rompy-0.3.0/rompy/model.py +0 -158
- rompy-0.3.0/rompy/schism/__init__.py +0 -3
- rompy-0.3.0/rompy/schism/data.py +0 -781
- rompy-0.3.0/rompy/schism/grid.py +0 -786
- rompy-0.3.0/rompy/schism/pyschism/dates.py +0 -164
- rompy-0.3.0/rompy/schism/pyschism/forcing/__init__.py +0 -18
- rompy-0.3.0/rompy/schism/pyschism/forcing/base.py +0 -5
- rompy-0.3.0/rompy/schism/pyschism/forcing/bctides/__init__.py +0 -4
- rompy-0.3.0/rompy/schism/pyschism/forcing/bctides/base.py +0 -17
- rompy-0.3.0/rompy/schism/pyschism/forcing/bctides/bctides.py +0 -345
- rompy-0.3.0/rompy/schism/pyschism/forcing/bctides/fes2014.py +0 -167
- rompy-0.3.0/rompy/schism/pyschism/forcing/bctides/hamtide.py +0 -117
- rompy-0.3.0/rompy/schism/pyschism/forcing/bctides/tides.py +0 -905
- rompy-0.3.0/rompy/schism/pyschism/forcing/bctides/tpxo.py +0 -190
- rompy-0.3.0/rompy/schism/pyschism/forcing/hycom/__init__.py +0 -4
- rompy-0.3.0/rompy/schism/pyschism/forcing/hycom/base.py +0 -102
- rompy-0.3.0/rompy/schism/pyschism/forcing/hycom/gofs.py +0 -883
- rompy-0.3.0/rompy/schism/pyschism/forcing/hycom/hycom2schism.py +0 -993
- rompy-0.3.0/rompy/schism/pyschism/forcing/hycom/rtofs2schism.py +0 -636
- rompy-0.3.0/rompy/schism/pyschism/mesh/__init__.py +0 -14
- rompy-0.3.0/rompy/schism/pyschism/mesh/base.py +0 -968
- rompy-0.3.0/rompy/schism/pyschism/mesh/boundaries.py +0 -255
- rompy-0.3.0/rompy/schism/pyschism/mesh/fgrid.py +0 -192
- rompy-0.3.0/rompy/schism/pyschism/mesh/figures.py +0 -92
- rompy-0.3.0/rompy/schism/pyschism/mesh/gridgr3.py +0 -236
- rompy-0.3.0/rompy/schism/pyschism/mesh/hgrid.py +0 -120
- rompy-0.3.0/rompy/schism/pyschism/mesh/parsers/grd.py +0 -204
- rompy-0.3.0/rompy/schism/pyschism/mesh/parsers/sms2dm.py +0 -109
- rompy-0.3.0/rompy/schism/pyschism/mesh/prop.py +0 -184
- rompy-0.3.0/rompy/schism/pyschism/mesh/vgrid.py +0 -442
- rompy-0.3.0/rompy/swan/__init__.py +0 -4
- rompy-0.3.0/rompy/swan/config.py +0 -234
- rompy-0.3.0/tests/schism/test_schism_csiro_migration.py +0 -46
- rompy-0.3.0/tests/schism/test_schism_data.py +0 -115
- rompy-0.3.0/tests/schism/test_vgridgenerators.py +0 -48
- rompy-0.3.0/tests/test_source.py +0 -248
- {rompy-0.3.0 → rompy-0.4.0}/LICENSE +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/MANIFEST.in +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/README.md +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/Makefile +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/make.bat +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/api.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/conf.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/demo.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/models.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/demo.ipynb +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/oceanum_example.ipynb +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/physics.ipynb +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/schism_procedural.ipynb +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/swan/.gitignore +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/swan/boundary/boundnest1.ipynb +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/swan/boundary/boundspec_segment.ipynb +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/swan/boundary/boundspec_side.ipynb +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/swan/components/output.ipynb +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/swan/example_declarative.ipynb +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/swan/example_declarative.yml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/swan/example_procedural.ipynb +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/swan/example_sensitivity.ipynb +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/swan/example_sensitivity.yml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/swan-config-components.ipynb +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/swan-config-components.yml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/templates/swan-physics-predefined/{{runtime.run_id}}/INPUT +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/notebooks/templates_demo.ipynb +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/quickstart.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/components/boundary.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/components/cgrid.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/components/group.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/components/inpgrid.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/components/lockup.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/components/numerics.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/components/output.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/components/physics.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/components/startup.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/index.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/subcomponents/base.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/subcomponents/boundary.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/subcomponents/cgrid.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/subcomponents/numerics.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/subcomponents/output.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/subcomponents/physics.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/subcomponents/readgrid.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/subcomponents/spectrum.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/subcomponents/startup.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/subcomponents/time.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/docs/source/swan/types.rst +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/notebooks/components/swan-config-components.yml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/notebooks/schism/demo.yaml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/notebooks/swan/example_declarative.yml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/notebooks/swan/example_sensitivity.yml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/.github/default.yml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/_version.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/archive/filesystem.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/archive/model.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/archive/test_filesystem.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/archive/test_model.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/archive/test_transform.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/archive/transform.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/catalogs/aodn.yaml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/catalogs/bom.yaml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/catalogs/csiro.yaml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/catalogs/dot_wa.yaml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/catalogs/gfs.yml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/catalogs/master.yaml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/catalogs/oceanum.yaml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/configuration/base.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/configuration/swan.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/core/__init__.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/core/filters.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/core/spectrum.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/plotting.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/interface.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/__init__.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/claude_full/ice.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/claude_full/icm.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/claude_full/mice.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/claude_full/param.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/claude_full/wwminput_WW3.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/claude_full/wwminput_spectra.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/cosine.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/example_nml.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/generate_models.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/generate_models_llm.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/generate_models_llm_sections.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/generate_models_llmv2.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/handwritten/cosine.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/handwritten/ice.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/handwritten/icm.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/handwritten/param.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/handwritten/sediment.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/ice.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/icm.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/mice.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/sample_inputs/render.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/sediment.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/sflux.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/wwminput.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/wwminput_WW3.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/schism/namelists/wwminput_spectra.py +0 -0
- /rompy-0.3.0/rompy/schism/pyschism/mesh/parsers/__init__.py → /rompy-0.4.0/rompy/schism/pyschism/dates.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/components/__init__.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/components/boundary.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/components/cgrid.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/components/inpgrid.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/subcomponents/__init__.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/subcomponents/numerics.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/subcomponents/physics.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/subcomponents/spectrum.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/swan/subcomponents/startup.py +0 -0
- {rompy-0.3.0/rompy/templates/base/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/base/{{runtime.staging_dir}}}/INPUT +0 -0
- {rompy-0.3.0/rompy/templates/base/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/base/{{runtime.staging_dir}}}/datasets/readme.md +0 -0
- {rompy-0.3.0/rompy/templates/base/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/base/{{runtime.staging_dir}}}/outputs/readme.md +0 -0
- {rompy-0.3.0/rompy/templates/schism/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/schism/{{runtime.staging_dir}}}/README +0 -0
- {rompy-0.3.0/rompy/templates/schism/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/schism/{{runtime.staging_dir}}}/datasets/readme.md +0 -0
- {rompy-0.3.0/rompy/templates/schism/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/schism/{{runtime.staging_dir}}}/outputs/readme.md +0 -0
- {rompy-0.3.0/rompy/templates/schism/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/schism/{{runtime.staging_dir}}}/sflux/README +0 -0
- {rompy-0.3.0/rompy/templates/schismcsiro/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/schismcsiro/{{runtime.staging_dir}}}/README +0 -0
- {rompy-0.3.0/rompy/templates/schismcsiro/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/schismcsiro/{{runtime.staging_dir}}}/datasets/readme.md +0 -0
- {rompy-0.3.0/rompy/templates/schismcsiro/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/schismcsiro/{{runtime.staging_dir}}}/outputs/readme.md +0 -0
- {rompy-0.3.0/rompy/templates/schismcsiro/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/schismcsiro/{{runtime.staging_dir}}}/param.nml +0 -0
- {rompy-0.3.0/rompy/templates/schismcsiro/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/schismcsiro/{{runtime.staging_dir}}}/sflux/README +0 -0
- {rompy-0.3.0/rompy/templates/schismcsiro/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/schismcsiro/{{runtime.staging_dir}}}/wwminput.nml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy/templates/swan/cookiecutter.json +0 -0
- {rompy-0.3.0/rompy/templates/swan/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/swan/{{runtime.staging_dir}}}/INPUT +0 -0
- {rompy-0.3.0/rompy/templates/swan/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/swan/{{runtime.staging_dir}}}/datasets/readme.md +0 -0
- {rompy-0.3.0/rompy/templates/swan/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/swan/{{runtime.staging_dir}}}/out.loc +0 -0
- {rompy-0.3.0/rompy/templates/swan/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/swan/{{runtime.staging_dir}}}/outputs/readme.md +0 -0
- {rompy-0.3.0/rompy/templates/swanbasic/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/swanbasic/{{runtime.staging_dir}}}/INPUT +0 -0
- {rompy-0.3.0/rompy/templates/swanbasic/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/swanbasic/{{runtime.staging_dir}}}/datasets/readme.md +0 -0
- {rompy-0.3.0/rompy/templates/swanbasic/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/swanbasic/{{runtime.staging_dir}}}/outputs/readme.md +0 -0
- {rompy-0.3.0/rompy/templates/swancomp/{{runtime.run_id}} → rompy-0.4.0/rompy/templates/swancomp/{{runtime.staging_dir}}}/INPUT +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/rompy.egg-info/dependency_links.txt +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/scripts/ci/environment-pip.yml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/setup.cfg +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/data/catalog.yaml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/data/wind.csv +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/example_configs/test.yaml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/schism/configs/csiro.yaml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/schism/test_data/download_era5_datamesh.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/schism/test_data/download_hycom.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/schism/test_data/download_tides.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/schism/utils.py +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/tests/swan/swan_model.yml +0 -0
- {rompy-0.3.0 → rompy-0.4.0}/versioneer.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rompy
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Relocatable Ocean Modelling in PYthon (rompy)
|
|
5
5
|
Author-email: CSIRO <paul.branson@csiro.au>
|
|
6
6
|
Maintainer-email: Paul Branson <paul.branson@csiro.au>, Tom Durrant <t.durrant@oceanum.science>, Rafael Guedes <r.guedes@oceanum.science>
|
|
@@ -72,6 +72,7 @@ Requires-Dist: oceanum
|
|
|
72
72
|
Requires-Dist: owslib
|
|
73
73
|
Requires-Dist: pandas
|
|
74
74
|
Requires-Dist: pydantic>2
|
|
75
|
+
Requires-Dist: pydantic-settings
|
|
75
76
|
Requires-Dist: pydantic_numpy
|
|
76
77
|
Requires-Dist: scipy
|
|
77
78
|
Requires-Dist: tqdm
|
|
@@ -82,13 +83,13 @@ Requires-Dist: appdirs
|
|
|
82
83
|
Provides-Extra: test
|
|
83
84
|
Requires-Dist: pytest; extra == "test"
|
|
84
85
|
Requires-Dist: envyaml; extra == "test"
|
|
86
|
+
Requires-Dist: coverage; extra == "test"
|
|
85
87
|
Provides-Extra: extra
|
|
86
88
|
Requires-Dist: gcsfs; extra == "extra"
|
|
87
89
|
Requires-Dist: zarr; extra == "extra"
|
|
88
90
|
Provides-Extra: schism
|
|
89
|
-
Requires-Dist:
|
|
90
|
-
Requires-Dist:
|
|
91
|
-
Requires-Dist: xmltodict; extra == "schism"
|
|
91
|
+
Requires-Dist: pylibs-ocean; extra == "schism"
|
|
92
|
+
Requires-Dist: pytmd; extra == "schism"
|
|
92
93
|
Provides-Extra: docs
|
|
93
94
|
Requires-Dist: autodoc_pydantic; extra == "docs"
|
|
94
95
|
Requires-Dist: ipython; extra == "docs"
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
.. _cli:
|
|
2
|
+
|
|
3
|
+
Command Line Interface
|
|
4
|
+
======================
|
|
5
|
+
|
|
6
|
+
The ROMPY Command Line Interface (CLI) provides a convenient way to run ocean, wave, and hydrodynamic models with configuration files.
|
|
7
|
+
|
|
8
|
+
Basic Usage
|
|
9
|
+
------------
|
|
10
|
+
|
|
11
|
+
The basic syntax for running a model is:
|
|
12
|
+
|
|
13
|
+
.. code-block:: bash
|
|
14
|
+
|
|
15
|
+
rompy <model> <config-file> [OPTIONS]
|
|
16
|
+
|
|
17
|
+
Where:
|
|
18
|
+
- ``<model>``: The type of model to run (e.g., swan, schism)
|
|
19
|
+
- ``<config-file>``: Path to a YAML or JSON configuration file
|
|
20
|
+
|
|
21
|
+
Available Models
|
|
22
|
+
-----------------
|
|
23
|
+
|
|
24
|
+
To list all available models, run:
|
|
25
|
+
|
|
26
|
+
.. code-block:: bash
|
|
27
|
+
|
|
28
|
+
rompy --version
|
|
29
|
+
|
|
30
|
+
This will display the ROMPY version and a list of available models.
|
|
31
|
+
|
|
32
|
+
Options
|
|
33
|
+
-------
|
|
34
|
+
|
|
35
|
+
.. program:: rompy
|
|
36
|
+
.. option:: --zip, --no-zip
|
|
37
|
+
|
|
38
|
+
Create a zip archive of the model files (default: False)
|
|
39
|
+
|
|
40
|
+
.. option:: -v, --verbose
|
|
41
|
+
|
|
42
|
+
Increase verbosity (can be used multiple times for more detail)
|
|
43
|
+
|
|
44
|
+
.. option:: --log-dir PATH
|
|
45
|
+
|
|
46
|
+
Directory to save log files
|
|
47
|
+
|
|
48
|
+
.. option:: --show-warnings
|
|
49
|
+
|
|
50
|
+
Show Python warnings (default: False)
|
|
51
|
+
|
|
52
|
+
.. option:: --ascii-only
|
|
53
|
+
|
|
54
|
+
Use ASCII-only characters in output (default: False)
|
|
55
|
+
|
|
56
|
+
.. option:: --simple-logs
|
|
57
|
+
|
|
58
|
+
Use simple log format without timestamps and module names (default: False)
|
|
59
|
+
|
|
60
|
+
.. option:: --version
|
|
61
|
+
|
|
62
|
+
Show version information and exit
|
|
63
|
+
|
|
64
|
+
Examples
|
|
65
|
+
--------
|
|
66
|
+
|
|
67
|
+
Run a SWAN model with a configuration file:
|
|
68
|
+
|
|
69
|
+
.. code-block:: bash
|
|
70
|
+
|
|
71
|
+
rompy swan config.yml
|
|
72
|
+
|
|
73
|
+
Run with increased verbosity and save logs to a directory:
|
|
74
|
+
|
|
75
|
+
.. code-block:: bash
|
|
76
|
+
|
|
77
|
+
rompy swan config.yml -v --log-dir ./logs
|
|
78
|
+
|
|
79
|
+
Run with ASCII-only output and simple logging format:
|
|
80
|
+
|
|
81
|
+
.. code-block:: bash
|
|
82
|
+
|
|
83
|
+
rompy swan config.yml --ascii-only --simple-logs
|
|
84
|
+
|
|
85
|
+
Environment Variables
|
|
86
|
+
----------------------
|
|
87
|
+
|
|
88
|
+
You can set the following environment variables as an alternative to command-line options:
|
|
89
|
+
|
|
90
|
+
- ``ROMPY_MODEL``: Default model to use
|
|
91
|
+
- ``ROMPY_CONFIG``: Default configuration file
|
|
92
|
+
- ``ROMPY_ZIP``: Set to "1" to enable zip output
|
|
93
|
+
- ``ROMPY_LOG_DIR``: Directory for log files
|
|
94
|
+
- ``ROMPY_ASCII_ONLY``: Set to "1" for ASCII-only output
|
|
95
|
+
- ``ROMPY_SIMPLE_LOGS``: Set to "1" for simple log format
|
|
96
|
+
|
|
97
|
+
Configuration File Format
|
|
98
|
+
--------------------------
|
|
99
|
+
|
|
100
|
+
The configuration file can be in either YAML or JSON format. The structure depends on the specific model being used. Refer to the model's documentation for details.
|
|
101
|
+
|
|
102
|
+
Example YAML configuration:
|
|
103
|
+
|
|
104
|
+
.. code-block:: yaml
|
|
105
|
+
|
|
106
|
+
model_type: "swan"
|
|
107
|
+
start_time: "2023-01-01T00:00:00"
|
|
108
|
+
end_time: "2023-01-02T00:00:00"
|
|
109
|
+
time_step: 3600
|
|
110
|
+
grid:
|
|
111
|
+
nx: 100
|
|
112
|
+
ny: 100
|
|
113
|
+
dx: 1000
|
|
114
|
+
dy: 1000
|
|
115
|
+
# Additional model-specific parameters...
|
|
116
|
+
|
|
117
|
+
Exit Codes
|
|
118
|
+
----------
|
|
119
|
+
|
|
120
|
+
The CLI uses the following exit codes:
|
|
121
|
+
|
|
122
|
+
- ``0``: Success
|
|
123
|
+
- ``1``: Error running the model
|
|
124
|
+
- ``2``: Invalid arguments or configuration
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
Core Concepts
|
|
3
3
|
=================================
|
|
4
4
|
|
|
5
|
+
.. note::
|
|
6
|
+
For information about Rompy's formatting and logging system, see :doc:`formatting_and_logging`.
|
|
7
|
+
|
|
8
|
+
For details on using the command line interface, see :doc:`cli`.
|
|
9
|
+
|
|
5
10
|
Rompy is a Python library for generating ocean model control files and required input
|
|
6
11
|
data ready for ingestion into the model. The framework is separated into two broad
|
|
7
12
|
concepts:
|
|
@@ -12,7 +17,7 @@ concepts:
|
|
|
12
17
|
:toctree: _generated/
|
|
13
18
|
|
|
14
19
|
rompy.model.ModelRun
|
|
15
|
-
rompy.core.BaseConfig
|
|
20
|
+
rompy.core.config.BaseConfig
|
|
16
21
|
|
|
17
22
|
There is information about each of these in the documentation of each object, but at a
|
|
18
23
|
high level, ModelRun is the high level framework that renders the config object and controls the
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
============================
|
|
2
|
+
Formatting and Logging
|
|
3
|
+
============================
|
|
4
|
+
|
|
5
|
+
Overview
|
|
6
|
+
--------
|
|
7
|
+
|
|
8
|
+
ROMPY provides a comprehensive framework for consistent formatting and logging across the codebase. This framework ensures that:
|
|
9
|
+
|
|
10
|
+
1. Log messages are consistent and configurable
|
|
11
|
+
2. String representations of objects are clear and hierarchical
|
|
12
|
+
3. Output formatting is visually appealing and consistent
|
|
13
|
+
4. Configuration is flexible and environment-aware
|
|
14
|
+
|
|
15
|
+
Core Components
|
|
16
|
+
--------------
|
|
17
|
+
|
|
18
|
+
The framework consists of several key components:
|
|
19
|
+
|
|
20
|
+
1. **Centralized Logging System**
|
|
21
|
+
- Consistent log formatting and handling
|
|
22
|
+
- Environment variable configuration
|
|
23
|
+
- Multiple log levels and output formats
|
|
24
|
+
|
|
25
|
+
2. **Hierarchical String Representation**
|
|
26
|
+
- Clean, readable output of complex objects
|
|
27
|
+
- Recursive handling of nested structures
|
|
28
|
+
- Type-specific formatting
|
|
29
|
+
|
|
30
|
+
3. **Formatted Output**
|
|
31
|
+
- Boxes and visual elements
|
|
32
|
+
- Consistent headers and footers
|
|
33
|
+
- Progress indicators
|
|
34
|
+
|
|
35
|
+
Logging System
|
|
36
|
+
-------------
|
|
37
|
+
|
|
38
|
+
ROMPY's logging system is built on Python's standard `logging` module but provides additional features and consistency.
|
|
39
|
+
|
|
40
|
+
Basic Usage
|
|
41
|
+
~~~~~~~~~~
|
|
42
|
+
|
|
43
|
+
.. code-block:: python
|
|
44
|
+
|
|
45
|
+
from rompy.core.logging import get_logger
|
|
46
|
+
|
|
47
|
+
# Get a logger for your module
|
|
48
|
+
logger = get_logger(__name__)
|
|
49
|
+
|
|
50
|
+
# Log messages at different levels
|
|
51
|
+
logger.debug("Detailed debug information")
|
|
52
|
+
logger.info("Informational message")
|
|
53
|
+
logger.warning("Warning message")
|
|
54
|
+
logger.error("Error message")
|
|
55
|
+
logger.critical("Critical error")
|
|
56
|
+
|
|
57
|
+
Configuration
|
|
58
|
+
~~~~~~~~~~~~~
|
|
59
|
+
|
|
60
|
+
Logging can be configured via environment variables:
|
|
61
|
+
|
|
62
|
+
.. list-table::
|
|
63
|
+
:widths: 25 15 60
|
|
64
|
+
:header-rows: 1
|
|
65
|
+
|
|
66
|
+
* - Variable
|
|
67
|
+
- Default
|
|
68
|
+
- Description
|
|
69
|
+
* - ``ROMPY_LOG_LEVEL``
|
|
70
|
+
- ``INFO``
|
|
71
|
+
- Minimum log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
|
|
72
|
+
* - ``ROMPY_LOG_FORMAT``
|
|
73
|
+
- ``detailed``
|
|
74
|
+
- Log format style (``simple`` or ``detailed``)
|
|
75
|
+
* - ``ROMPY_LOG_FILE``
|
|
76
|
+
- None
|
|
77
|
+
- Optional file path for log output
|
|
78
|
+
|
|
79
|
+
Programmatic configuration is also available:
|
|
80
|
+
|
|
81
|
+
.. code-block:: python
|
|
82
|
+
|
|
83
|
+
from rompy.core.logging import configure_logging
|
|
84
|
+
|
|
85
|
+
configure_logging(
|
|
86
|
+
level="DEBUG",
|
|
87
|
+
format="detailed",
|
|
88
|
+
log_file="rompy.log"
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
Hierarchical String Representation
|
|
92
|
+
--------------------------------
|
|
93
|
+
|
|
94
|
+
All ROMPY models include a hierarchical string representation for better readability of complex objects.
|
|
95
|
+
|
|
96
|
+
Basic Usage
|
|
97
|
+
~~~~~~~~~~
|
|
98
|
+
|
|
99
|
+
.. code-block:: python
|
|
100
|
+
|
|
101
|
+
class MyModel(RompyBaseModel):
|
|
102
|
+
name: str
|
|
103
|
+
value: float
|
|
104
|
+
nested: dict
|
|
105
|
+
|
|
106
|
+
obj = MyModel(name="test", value=42.0, nested={"a": 1, "b": 2})
|
|
107
|
+
print(obj)
|
|
108
|
+
|
|
109
|
+
Output:
|
|
110
|
+
|
|
111
|
+
.. code-block:: text
|
|
112
|
+
|
|
113
|
+
MyModel:
|
|
114
|
+
name: test
|
|
115
|
+
value: 42.0
|
|
116
|
+
nested:
|
|
117
|
+
a: 1
|
|
118
|
+
b: 2
|
|
119
|
+
|
|
120
|
+
Custom Formatting
|
|
121
|
+
~~~~~~~~~~~~~~~~
|
|
122
|
+
|
|
123
|
+
Customize formatting by overriding the `_format_value` method:
|
|
124
|
+
|
|
125
|
+
.. code-block:: python
|
|
126
|
+
|
|
127
|
+
class CustomModel(RompyBaseModel):
|
|
128
|
+
timestamp: datetime
|
|
129
|
+
|
|
130
|
+
def _format_value(self, obj: Any) -> Optional[str]:
|
|
131
|
+
if isinstance(obj, datetime):
|
|
132
|
+
return obj.strftime("%Y-%m-%d %H:%M")
|
|
133
|
+
return None
|
|
134
|
+
|
|
135
|
+
Formatted Output
|
|
136
|
+
---------------
|
|
137
|
+
|
|
138
|
+
ROMPY provides utilities for creating consistent, visually appealing output.
|
|
139
|
+
|
|
140
|
+
Boxes and Sections
|
|
141
|
+
~~~~~~~~~~~~~~~~~
|
|
142
|
+
|
|
143
|
+
.. code-block:: python
|
|
144
|
+
|
|
145
|
+
from rompy.core.formatting import box, section
|
|
146
|
+
|
|
147
|
+
# Create a simple box
|
|
148
|
+
print(box("Important Message"))
|
|
149
|
+
|
|
150
|
+
# Create a section with content
|
|
151
|
+
print(section("Processing Results", ["Item 1", "Item 2", "Item 3"]))
|
|
152
|
+
|
|
153
|
+
Progress Indicators
|
|
154
|
+
~~~~~~~~~~~~~~~~~~
|
|
155
|
+
|
|
156
|
+
.. code-block:: python
|
|
157
|
+
|
|
158
|
+
from rompy.core.formatting import ProgressBar
|
|
159
|
+
import time
|
|
160
|
+
|
|
161
|
+
with ProgressBar("Processing", total=100) as pbar:
|
|
162
|
+
for i in range(100):
|
|
163
|
+
time.sleep(0.1)
|
|
164
|
+
pbar.update(1)
|
|
165
|
+
|
|
166
|
+
Best Practices
|
|
167
|
+
-------------
|
|
168
|
+
|
|
169
|
+
1. **Logging**
|
|
170
|
+
- Use appropriate log levels (DEBUG for detailed info, INFO for normal operations, etc.)
|
|
171
|
+
- Include relevant context in log messages
|
|
172
|
+
- Use structured logging for machine-readable output
|
|
173
|
+
|
|
174
|
+
2. **String Representation**
|
|
175
|
+
- Keep string representations concise but informative
|
|
176
|
+
- Include all relevant attributes
|
|
177
|
+
- Handle nested objects appropriately
|
|
178
|
+
|
|
179
|
+
3. **Formatting**
|
|
180
|
+
- Be consistent with formatting across the codebase
|
|
181
|
+
- Use the provided utilities for common formatting needs
|
|
182
|
+
- Consider readability in different output contexts (CLI, logs, etc.)
|
|
183
|
+
|
|
184
|
+
Example Integration
|
|
185
|
+
------------------
|
|
186
|
+
|
|
187
|
+
Here's how these components work together in a typical ROMPY module:
|
|
188
|
+
|
|
189
|
+
.. code-block:: python
|
|
190
|
+
|
|
191
|
+
from rompy.core.logging import get_logger
|
|
192
|
+
from rompy.core.formatting import section
|
|
193
|
+
from rompy.core.types import RompyBaseModel
|
|
194
|
+
|
|
195
|
+
logger = get_logger(__name__)
|
|
196
|
+
|
|
197
|
+
class DataProcessor(RompyBaseModel):
|
|
198
|
+
"""Process data with logging and formatted output."""
|
|
199
|
+
|
|
200
|
+
def process(self, data):
|
|
201
|
+
logger.info("Starting data processing")
|
|
202
|
+
|
|
203
|
+
with section("Processing Data"):
|
|
204
|
+
# Process data here
|
|
205
|
+
logger.debug(f"Processing {len(data)} items")
|
|
206
|
+
|
|
207
|
+
# Log progress
|
|
208
|
+
for i, item in enumerate(data, 1):
|
|
209
|
+
self._process_item(item)
|
|
210
|
+
logger.debug(f"Processed item {i}/{len(data)}")
|
|
211
|
+
|
|
212
|
+
logger.info("Processing complete")
|
|
213
|
+
|
|
214
|
+
def _process_item(self, item):
|
|
215
|
+
# Process individual items
|
|
216
|
+
pass
|
|
@@ -34,10 +34,12 @@ The final main component of the library is an intake driver that builds on the i
|
|
|
34
34
|
Home <self>
|
|
35
35
|
quickstart
|
|
36
36
|
core_concepts
|
|
37
|
+
formatting_and_logging
|
|
38
|
+
cli
|
|
39
|
+
backends
|
|
37
40
|
models
|
|
38
41
|
demo
|
|
39
42
|
api
|
|
40
|
-
relational_diagrams
|
|
41
43
|
|
|
42
44
|
Indices and tables
|
|
43
45
|
==================
|