Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converted the reference data to regression in test TARDIS full #2611

Merged

Conversation

airvzxf
Copy link
Contributor

@airvzxf airvzxf commented May 10, 2024

📝 Description

Type: 🎢 infrastructure

Write a complete description of your changes, including the necessary context or any piece of information required to understand your work.

The test for TARDIS full is used the reference data, this pull request shows the conversion to regression data.

It needs to generate or update the data for regression, which is in this pull request: tardis-sn/tardis-regression-data#6.

Also, link issues affected by this pull request by using the keywords: close, closes, closed, fix, fixes, fixed, resolve, resolves or resolved.

N/A

Evidence

To validadate this migration, I executed the unit tests (PyTest) for this specific changes (test_tardis_full.py).

Executed: time pytest tardis/tests/test_tardis_full.py --tardis-refdata=/app/tardis-refdata --tardis-regression-data=/app/tardis-regression-data --capture=sys --verbose.

This is using the regression data, as it shows in the output: Closing remaining open files:/app/tardis-regression-data/tardis/tests/test_tardis_full/test_transport_simple/TestTransportSimple.h5...done

============================= test session starts ==============================
platform linux -- Python 3.11.5, pytest-7.4.2, pluggy-1.3.0 -- /opt/conda/envs/tardis/bin/python3.11
cachedir: .pytest_cache
metadata: {'Python': '3.11.5', 'Platform': 'Linux-6.8.7-arch1-1-x86_64-with-glibc2.31', 'Packages': {'pytest': '7.4.2', 'pluggy': '1.3.0'}, 'Plugins': {'html': '3.2.0', 'anyio': '4.0.0', 'doctestplus': '1.0.0', 'syrupy': '4.5.0', 'metadata': '3.0.0', 'cov': '4.1.0'}}
rootdir: /app/code
configfile: setup.cfg
plugins: html-3.2.0, anyio-4.0.0, doctestplus-1.0.0, syrupy-4.5.0, metadata-3.0.0, cov-4.1.0
collecting ... collected 4 items

tardis/tests/test_tardis_full.py::test_run_tardis_from_config_obj PASSED [ 25%]
tardis/tests/test_tardis_full.py::TestTransportSimple::test_j_blue_estimators PASSED [ 50%]
tardis/tests/test_tardis_full.py::TestTransportSimple::test_spectrum PASSED [ 75%]
tardis/tests/test_tardis_full.py::TestTransportSimple::test_virtual_spectrum PASSED [100%]

=============================== warnings summary ===============================
../../opt/conda/envs/tardis/lib/python3.11/site-packages/jupyter_client/connect.py:20
  /opt/conda/envs/tardis/lib/python3.11/site-packages/jupyter_client/connect.py:20: DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs
  given by the platformdirs library.  To remove this warning and
  see the appropriate new directories, set the environment variable
  `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
  The use of platformdirs will be the default in `jupyter_core` v6
    from jupyter_core.paths import jupyter_data_dir, jupyter_runtime_dir, secure_write

tardis/io/configuration/config_validator.py:6
tardis/io/configuration/config_validator.py:6
  /app/code/tardis/io/configuration/config_validator.py:6: DeprecationWarning: jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.
    from jsonschema import Draft4Validator, RefResolver, validators

../../opt/conda/envs/tardis/lib/python3.11/site-packages/qgrid/grid.py:30
../../opt/conda/envs/tardis/lib/python3.11/site-packages/qgrid/grid.py:30
  /opt/conda/envs/tardis/lib/python3.11/site-packages/qgrid/grid.py:30: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    if LooseVersion(pd.__version__) > LooseVersion('0.20.0'):

../../opt/conda/envs/tardis/lib/python3.11/site-packages/ipywidgets/widgets/widget.py:303
  /opt/conda/envs/tardis/lib/python3.11/site-packages/ipywidgets/widgets/widget.py:303: DeprecationWarning: Widget registration using a string name has been deprecated. Widget registration now uses a plain `@register` decorator.
    warnings.warn("Widget registration using a string name has been deprecated. Widget registration now uses a plain `@register` decorator.", DeprecationWarning)

../../opt/conda/envs/tardis/lib/python3.11/site-packages/traitlets/traitlets.py:545
  /opt/conda/envs/tardis/lib/python3.11/site-packages/traitlets/traitlets.py:545: DeprecationWarning: metadata {'sync': True} was set from the constructor. With traitlets 4.1, metadata should be set using the .tag() method, e.g., Int().tag(key1='value1', key2='value2')
    warn(

tardis/conftest.py:168
  /app/code/tardis/conftest.py:168: PytestDeprecationWarning: @pytest.yield_fixture is deprecated.
  Use @pytest.fixture instead; they are the same.
    @pytest.yield_fixture(scope="session")

../../opt/conda/envs/tardis/lib/python3.11/site-packages/_pytest/config/__init__.py:1373
  /opt/conda/envs/tardis/lib/python3.11/site-packages/_pytest/config/__init__.py:1373: PytestConfigWarning: Unknown config option: astropy_header
  
    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

tardis/tests/test_tardis_full.py::TestTransportSimple::test_j_blue_estimators
tardis/tests/test_tardis_full.py::TestTransportSimple::test_j_blue_estimators
tardis/tests/test_tardis_full.py::TestTransportSimple::test_j_blue_estimators
tardis/tests/test_tardis_full.py::TestTransportSimple::test_j_blue_estimators
tardis/tests/test_tardis_full.py::TestTransportSimple::test_j_blue_estimators
tardis/tests/test_tardis_full.py::TestTransportSimple::test_j_blue_estimators
  /app/code/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
    (g_lower * n_upper) / (g_upper * n_lower)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================== 4 passed, 15 warnings in 94.69s (0:01:34) ===================
Closing remaining open files:/app/tardis-regression-data/tardis/tests/test_tardis_full/test_transport_simple/TestTransportSimple.h5...done

real    1m38.947s
user    1m35.862s
sys     0m3.557s

To validate that the migration to the regression is working with the same reference data. I extracted the data for unit_test_data.h5 and put in tardis/tests/test_tardis_full/test_transport_simple/TestTransportSimple.h5.

Executed: h5diff -r unit_test_data.h5 TestTransportSimple.h5 /test_transport_simple/transport_state/j_blue_estimator /transport_state/j_blue_estimator.

attribute: <CLASS of </test_transport_simple/transport_state/j_blue_estimator>> and <CLASS of </transport_state/j_blue_estimator>>
0 differences found
attribute: <TITLE of </test_transport_simple/transport_state/j_blue_estimator>> and <TITLE of </transport_state/j_blue_estimator>>
0 differences found
attribute: <VERSION of </test_transport_simple/transport_state/j_blue_estimator>> and <VERSION of </transport_state/j_blue_estimator>>
0 differences found
attribute: <axis0_variety of </test_transport_simple/transport_state/j_blue_estimator>> and <axis0_variety of </transport_state/j_blue_estimator>>
0 differences found
attribute: <axis1_variety of </test_transport_simple/transport_state/j_blue_estimator>> and <axis1_variety of </transport_state/j_blue_estimator>>
0 differences found
attribute: <block0_items_variety of </test_transport_simple/transport_state/j_blue_estimator>> and <block0_items_variety of </transport_state/j_blue_estimator>>
0 differences found
attribute: <encoding of </test_transport_simple/transport_state/j_blue_estimator>> and <encoding of </transport_state/j_blue_estimator>>
0 differences found
attribute: <errors of </test_transport_simple/transport_state/j_blue_estimator>> and <errors of </transport_state/j_blue_estimator>>
0 differences found
attribute: <nblocks of </test_transport_simple/transport_state/j_blue_estimator>> and <nblocks of </transport_state/j_blue_estimator>>
0 differences found
attribute: <ndim of </test_transport_simple/transport_state/j_blue_estimator>> and <ndim of </transport_state/j_blue_estimator>>
0 differences found
attribute: <pandas_type of </test_transport_simple/transport_state/j_blue_estimator>> and <pandas_type of </transport_state/j_blue_estimator>>
0 differences found
attribute: <pandas_version of </test_transport_simple/transport_state/j_blue_estimator>> and <pandas_version of </transport_state/j_blue_estimator>>
0 differences found
dataset: </test_transport_simple/transport_state/j_blue_estimator/axis0> and </transport_state/j_blue_estimator/axis0>
0 differences found
attribute: <CLASS of </test_transport_simple/transport_state/j_blue_estimator/axis0>> and <CLASS of </transport_state/j_blue_estimator/axis0>>
0 differences found
attribute: <FLAVOR of </test_transport_simple/transport_state/j_blue_estimator/axis0>> and <FLAVOR of </transport_state/j_blue_estimator/axis0>>
0 differences found
attribute: <TITLE of </test_transport_simple/transport_state/j_blue_estimator/axis0>> and <TITLE of </transport_state/j_blue_estimator/axis0>>
0 differences found
attribute: <VERSION of </test_transport_simple/transport_state/j_blue_estimator/axis0>> and <VERSION of </transport_state/j_blue_estimator/axis0>>
0 differences found
attribute: <kind of </test_transport_simple/transport_state/j_blue_estimator/axis0>> and <kind of </transport_state/j_blue_estimator/axis0>>
0 differences found
attribute: <name of </test_transport_simple/transport_state/j_blue_estimator/axis0>> and <name of </transport_state/j_blue_estimator/axis0>>
0 differences found
attribute: <transposed of </test_transport_simple/transport_state/j_blue_estimator/axis0>> and <transposed of </transport_state/j_blue_estimator/axis0>>
0 differences found
dataset: </test_transport_simple/transport_state/j_blue_estimator/axis1> and </transport_state/j_blue_estimator/axis1>
0 differences found
attribute: <CLASS of </test_transport_simple/transport_state/j_blue_estimator/axis1>> and <CLASS of </transport_state/j_blue_estimator/axis1>>
0 differences found
attribute: <FLAVOR of </test_transport_simple/transport_state/j_blue_estimator/axis1>> and <FLAVOR of </transport_state/j_blue_estimator/axis1>>
0 differences found
attribute: <TITLE of </test_transport_simple/transport_state/j_blue_estimator/axis1>> and <TITLE of </transport_state/j_blue_estimator/axis1>>
0 differences found
attribute: <VERSION of </test_transport_simple/transport_state/j_blue_estimator/axis1>> and <VERSION of </transport_state/j_blue_estimator/axis1>>
0 differences found
attribute: <kind of </test_transport_simple/transport_state/j_blue_estimator/axis1>> and <kind of </transport_state/j_blue_estimator/axis1>>
0 differences found
attribute: <name of </test_transport_simple/transport_state/j_blue_estimator/axis1>> and <name of </transport_state/j_blue_estimator/axis1>>
0 differences found
attribute: <transposed of </test_transport_simple/transport_state/j_blue_estimator/axis1>> and <transposed of </transport_state/j_blue_estimator/axis1>>
0 differences found
dataset: </test_transport_simple/transport_state/j_blue_estimator/block0_items> and </transport_state/j_blue_estimator/block0_items>
0 differences found
attribute: <CLASS of </test_transport_simple/transport_state/j_blue_estimator/block0_items>> and <CLASS of </transport_state/j_blue_estimator/block0_items>>
0 differences found
attribute: <FLAVOR of </test_transport_simple/transport_state/j_blue_estimator/block0_items>> and <FLAVOR of </transport_state/j_blue_estimator/block0_items>>
0 differences found
attribute: <TITLE of </test_transport_simple/transport_state/j_blue_estimator/block0_items>> and <TITLE of </transport_state/j_blue_estimator/block0_items>>
0 differences found
attribute: <VERSION of </test_transport_simple/transport_state/j_blue_estimator/block0_items>> and <VERSION of </transport_state/j_blue_estimator/block0_items>>
0 differences found
attribute: <kind of </test_transport_simple/transport_state/j_blue_estimator/block0_items>> and <kind of </transport_state/j_blue_estimator/block0_items>>
0 differences found
attribute: <name of </test_transport_simple/transport_state/j_blue_estimator/block0_items>> and <name of </transport_state/j_blue_estimator/block0_items>>
0 differences found
attribute: <transposed of </test_transport_simple/transport_state/j_blue_estimator/block0_items>> and <transposed of </transport_state/j_blue_estimator/block0_items>>
0 differences found
dataset: </test_transport_simple/transport_state/j_blue_estimator/block0_values> and </transport_state/j_blue_estimator/block0_values>
0 differences found
attribute: <CLASS of </test_transport_simple/transport_state/j_blue_estimator/block0_values>> and <CLASS of </transport_state/j_blue_estimator/block0_values>>
0 differences found
attribute: <FLAVOR of </test_transport_simple/transport_state/j_blue_estimator/block0_values>> and <FLAVOR of </transport_state/j_blue_estimator/block0_values>>
0 differences found
attribute: <TITLE of </test_transport_simple/transport_state/j_blue_estimator/block0_values>> and <TITLE of </transport_state/j_blue_estimator/block0_values>>
0 differences found
attribute: <VERSION of </test_transport_simple/transport_state/j_blue_estimator/block0_values>> and <VERSION of </transport_state/j_blue_estimator/block0_values>>
0 differences found
attribute: <transposed of </test_transport_simple/transport_state/j_blue_estimator/block0_values>> and <transposed of </transport_state/j_blue_estimator/block0_values>>
0 differences found

📌 Resources

Examples, notebooks, and links to useful references.

🚦 Testing

How did you test these changes?

  • Testing pipeline
  • Other method: Running locally the unit test with regression data. Furthermore, it generated the HDF file successful.
  • My changes can't be tested (explain why)

☑️ Checklist

  • I requested two reviewers for this pull request
  • I updated the documentation according to my changes
  • I built the documentation by applying the build_docs label

Note: If you are not allowed to perform any of these actions, ping (@) a contributor.

@atharva-2001
Copy link
Member

/update-refdata

andrewfullard
andrewfullard previously approved these changes May 10, 2024
@tardis-bot
Copy link
Contributor

*beep* *bop*

Hi, human.

The update-refdata workflow has failed

Click here to see the build log.

@andrewfullard
Copy link
Contributor

Tests pass, so I am happy

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@andrewfullard andrewfullard self-requested a review May 10, 2024 17:13
@andrewfullard
Copy link
Contributor

@wkerzendorf @atharva-2001 I think your reviews can get this merged.

Copy link
Member

@atharva-2001 atharva-2001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@andrewfullard andrewfullard merged commit 860482c into tardis-sn:master May 14, 2024
9 of 10 checks passed
@airvzxf airvzxf deleted the feat/regression-test-tardis-full branch May 15, 2024 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants