Skip to content

Commit

Permalink
refactor: rename files and correct headers and docstrings
Browse files Browse the repository at this point in the history
docs: correct docstring of graupel wrapper
  • Loading branch information
yoctoyotta1024 committed Nov 22, 2024
1 parent bf96c10 commit 41050ec
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 47 deletions.
11 changes: 6 additions & 5 deletions libs/icon_graupel/microphysics_scheme_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
----- Microphysics Test Cases -----
File: microphysics_scheme_wrapper.py
Project: mock_microphys
Project: icon_graupel
Created Date: Wednesday 28th February 2024
Author: Clara Bayley (CB)
Additional Contributors: Joerg Behrens, Georgiana Mania
-----
Last Modified: Sunday 1st September 2024
Last Modified: Friday 22nd November 2024
Modified By: CB
-----
License: BSD 3-Clause "New" or "Revised" License
Expand All @@ -31,10 +31,11 @@


class MicrophysicsSchemeWrapper:
"""A class wrapping around Python MicrophysicsScheme for compatibility purposes.
"""A class wrapping around C++ bindings to ICON's graupel one-moment MicrophysicsScheme
(wrapper for compatibility purposes).
This class wraps around the MicrophysicsScheme class to provide compatibility with the Python
run scripts and tests in this project. It initializes a MicrophysicsScheme object and provides
This class wraps around the graupel class to provide compatibility with the Python
run scripts and tests in this project. It initializes ICON's microphysics object and provides
wrappers around methods to initialize, finalize, and run the microphysics.
Args:
Expand Down
6 changes: 3 additions & 3 deletions libs/icon_satadj/microphysics_scheme_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
----- Microphysics Test Cases -----
File: microphysics_scheme_wrapper.py
Project: mock_microphys
Created Date: Wednesday 28th February 2024
Project: icon_satadj
Created Date: Thursday 21st November 2024
Author: Clara Bayley (CB)
Additional Contributors: Joerg Behrens, Georgiana Mania
-----
Last Modified: Sunday 1st September 2024
Last Modified: Friday 22nd November 2024
Modified By: CB
-----
License: BSD 3-Clause "New" or "Revised" License
Expand Down
2 changes: 1 addition & 1 deletion libs/pympdata_bulk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
----- Microphysics Test Cases -----
File: __init__.py
Project: pympdata_microphysics
Project: pympdata_bulk
Created Date: Monday 2nd September 2024
Author: Clara Bayley (CB)
Additional Contributors:
Expand Down
2 changes: 1 addition & 1 deletion libs/pympdata_bulk/bulk_scheme_condensation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
----- Microphysics Test Cases -----
File: bulk_scheme_condensation.py
Project: pympdata_microphysics
Project: pympdata_bulk
Created Date: Monday 2nd September 2024
Author: Clara Bayley (CB)
Additional Contributors:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Copyright (c) 2024 MPI-M, Clara Bayley
----- Microphysics Test Cases -----
File: test_mock_py.py
File: test_icon_graupel.py
Project: test_case_0dparcel
Created Date: Wednesday 28th February 2024
Author: Clara Bayley (CB)
Expand All @@ -15,7 +15,8 @@
https://opensource.org/licenses/BSD-3-Clause
-----
File Description:
perform test case for 0-D parcel model with mock python microphysics scheme
perform test case for 0-D parcel model with python bindings to ICON graupel
one-moment bulk microphysics scheme
"""

import numpy as np
Expand All @@ -28,13 +29,13 @@
from .perform_0dparcel_test_case import perform_0dparcel_test_case
from libs.thermo.thermodynamics import Thermodynamics

def test_graupel_py_0dparcel():
"""runs 0-D parcel model test using Python mock microphysics scheme (a mock-up of the muphys-cpp
graupel class for ICON).
def test_icon_graupel_0dparcel():
"""runs 0-D parcel model test using ICON's one-moment bulk scheme
as a MicrophysicsScheme (with its "graupel" microphysics).
This function sets up initial conditions and parameters for running a 0-D parcel model
test case using the Python mock microphysics scheme (via a wrapper). It then runs the
0-D parcel test case as specified.
test case using the ICON graupel microphysics scheme (via bindings and a wrapper).
It then runs the 0-D parcel test case as specified.
Test Parameters:
Timestepping:
Expand All @@ -61,7 +62,7 @@ def test_graupel_py_0dparcel():
"""

### label for test case to name data/plots with
run_name = "python_microphys_0dparcel"
run_name = "icon_graupel_0dparcel"

### path to directory to save data/plots in after model run
binpath = (
Expand Down
11 changes: 6 additions & 5 deletions tests/test_case_0dparcel/test_icon_satadj.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@
Copyright (c) 2024 MPI-M, Clara Bayley
----- Microphysics Test Cases -----
File: test_mock_py.py
File: test_icon_satadj.py
Project: test_case_0dparcel
Created Date: Wednesday 28th February 2024
Created Date: Thursday 21st November
Author: Clara Bayley (CB)
Additional Contributors:
Additional Contributors: Joerg Behrens, Georgiana Mania
-----
Last Modified: Monday 11th November 2024
Last Modified: Friday 22nd November
Modified By: CB
-----
License: BSD 3-Clause "New" or "Revised" License
https://opensource.org/licenses/BSD-3-Clause
-----
File Description:
perform test case for 0-D parcel model with mock python microphysics scheme
perform test case for 0-D parcel model with python bindings to saturation adjustment from
ICON graupel one-moment bulk microphysics scheme
"""

import os
Expand Down
4 changes: 2 additions & 2 deletions tests/test_case_0dparcel/test_mock_microphys.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from libs.mock_microphys.microphysics_scheme_wrapper import MicrophysicsSchemeWrapper


def test_mock_py_0dparcel():
def test_mock_0dparcel():
"""runs 0-D parcel model test using Python mock microphysics scheme (a mock-up of the muphys-cpp
graupel class for ICON).
Expand Down Expand Up @@ -59,7 +59,7 @@ def test_mock_py_0dparcel():
"""

### label for test case to name data/plots with
run_name = "python_mockmicrophys_0dparcel"
run_name = "mock_0dparcel"

### path to directory to save data/plots in after model run
binpath = Path(__file__).parent.resolve() / "bin" # i.e. [current directory]/bin/
Expand Down
10 changes: 5 additions & 5 deletions tests/test_case_0dparcel/test_pympdata_bulk.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
)


def test_pympdata_bulk_scheme_0dparcel():
"""runs 0-D parcel model test using Python mock microphysics scheme (a mock-up of the muphys-cpp
graupel class for ICON).
def test_pympdata_bulk_0dparcel():
"""runs 0-D parcel model test using Python pyMPDATA microphysics scheme
(only condensation part of saturation adjustment from bulk scheme).
This function sets up initial conditions and parameters for running a 0-D parcel model
test case using the Python mock microphysics scheme (via a wrapper). It then runs the
test case using the pyMPDATA microphysics scheme (via a wrapper). It then runs the
0-D parcel test case as specified.
Test Parameters:
Expand All @@ -55,7 +55,7 @@ def test_pympdata_bulk_scheme_0dparcel():
"""

### label for test case to name data/plots with
run_name = "pympdata_bulkmicrophys_0dparcel"
run_name = "pympdata_bulk_0dparcel"

### path to directory to save data/plots in after model run
binpath = Path(__file__).parent.resolve() / "bin" # i.e. [current directory]/bin/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
Project: test_case_1dkid
Created Date: Monday 2nd September 2024
Author: Clara Bayley (CB)
Additional Contributors:
Additional Contributors: Joerg Behrens, Georgiana Mania
-----
Last Modified: Wednesday 4th September 2024
Last Modified: Thursday 21st November 2024
Modified By: Joerg Behrens, Georgiana Mania
-----
License: BSD 3-Clause "New" or "Revised" License
Expand All @@ -30,16 +30,16 @@
from libs.thermo.thermodynamics import Thermodynamics
from libs.icon_graupel.microphysics_scheme_wrapper import MicrophysicsSchemeWrapper

def test_pympdata_bulk_scheme_1dkid():
"""runs test of 1-D KiD rainshaft model using bulk scheme for condensation
extracted from pyMPDATA for the microphysics scheme.
def test_icon_graupel_1dkid():
"""runs test of 1-D KiD rainshaft model using ICON's one-moment "graupel"
bulk scheme for the microphysics.
This function sets up initial conditions and parameters for running a 1-D KiD rainshaft
test case using the bulk microphysics scheme for condensation from the Shipway and Hill 2012
pyMPDATA-examples example (via a wrapper). It then runs the test case as specified.
test case using ICON's one-moment bulk microphysics scheme (with python bindings and
via a wrapper). It then runs the test case as specified.
"""
### label for test case to name data/plots with
run_name = "graupel_bulkmicrophys_1dkid"
run_name = "icon_graupel_1dkid"

### path to directory to save data/plots in after model run
binpath = (
Expand Down
2 changes: 1 addition & 1 deletion tests/test_case_1dkid/test_icon_satadj.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Project: test_case_1dkid
Created Date: Monday 2nd September 2024
Author: Clara Bayley (CB)
Additional Contributors:
Additional Contributors: Joerg Behrens, Georgiana Mania
-----
Last Modified: Wednesday 4th September 2024
Modified By: Joerg Behrens, Georgiana Mania
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
Copyright (c) 2024 MPI-M, Clara Bayley
----- Microphysics Test Cases -----
File: test_mock_py_microphysics_scheme.py
File: test_icon_graupel_microphysics_scheme.py
Project: tests
Created Date: Tuesday 27th February 2024
Author: Clara Bayley (CB)
Additional Contributors: Joerg Behrens, Georgiana Mania
-----
Last Modified: Monday 11th November 2024
Last Modified: Friday 22nd November 2024
Modified By: CB
-----
License: BSD 3-Clause "New" or "Revised" License
https://opensource.org/licenses/BSD-3-Clause
-----
File Description:
mock unit tests for Python microphysics module
unit tests for Python bindings of ICON's graupel one-moment bulk microphysics scheme
"""

import numpy as np
Expand Down
11 changes: 6 additions & 5 deletions tests/test_icon_satadj_microphysics_scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@
Copyright (c) 2024 MPI-M, Clara Bayley
----- Microphysics Test Cases -----
File: test_mock_py_microphysics_scheme.py
File: test_icon_satadj_microphysics_scheme.py
Project: tests
Created Date: Tuesday 27th February 2024
Created Date: Thursday 21st November 2024
Author: Clara Bayley (CB)
Additional Contributors:
Additional Contributors: Joerg Behrens, Georgiana Mania
-----
Last Modified: Monday 11th November 2024
Last Modified: Friday 22nd November 2024
Modified By: CB
-----
License: BSD 3-Clause "New" or "Revised" License
https://opensource.org/licenses/BSD-3-Clause
-----
File Description:
mock unit tests for Python microphysics module
unit tests for Python bindings to the saturation adjustment from ICON's
one-moment bulk microphysics scheme
"""

import numpy as np
Expand Down

0 comments on commit 41050ec

Please sign in to comment.