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

Nbval default ignore html and javascript output #73

Merged
merged 2 commits into from
May 19, 2021

Conversation

tlvu
Copy link
Contributor

@tlvu tlvu commented May 18, 2021

Overview

Ignore by default html and javascript output to decrease usage of NBVAL_IGNORE_OUTPUT.

Changes

Related Issue / Discussion

Additional Information

Nbval documentation was not 100% correct: computationalmodelling/nbval#168

tlvu added 2 commits May 17, 2021 17:44
…ecrease usage of NBVAL_IGNORE_OUTPUT

Following https://nbval.readthedocs.io/en/latest/index.html?highlight=skip#Skipping-certain-output-types

Error:
```
INTERNALERROR>   File "/opt/conda/envs/birdy/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/opt/conda/envs/birdy/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/repos/PAVICS-e2e-workflow-tests/conftest.py", line 2, in pytest_collectstart
INTERNALERROR>     collector.skip_compare += 'text/html', 'application/javascript',
INTERNALERROR> AttributeError: 'Session' object has no attribute 'skip_compare'
```
…rease usage of NBVAL_IGNORE_OUTPUT

Fix the error found in the previous commit 36d2fb4.
@tlvu tlvu merged commit 7a498c1 into master May 19, 2021
@tlvu tlvu deleted the nbval-default-ignore-html-and-javascript-output branch May 19, 2021 21:13
tlvu added a commit to Ouranosinc/pavics-sdi that referenced this pull request May 27, 2021
Also removed `NBVAL_IGNORE_OUTPUT` since Jenkins is configured to by
default ignore html changes, see PR
Ouranosinc/PAVICS-e2e-workflow-tests#73.

To fix this error:
```
  _______ pavics-sdi-master/docs/source/notebooks/subsetting.ipynb::Cell 2 _______
  Notebook cell execution failed
  Cell 2: Cell outputs differ

  Input:
  help(fp.subset_continents)

  Traceback:
   mismatch 'stdout'

   assert reference_output == test_output failed:

    'Help on meth... outputs.\n\n' == 'Help on meth... outputs.\n\n'
    Skipping 101 identical leading characters in diff, use -v to show
    - n='Africa') method of birdy.client.base.WPSClient instance
    + n='Africa', output_formats=None) method of birdy.client.base.WPSClient instance
    ?           +++++++++++++++++++++
          Return the data whose grid cells intersect the selected continents for each input dataset.

          Parameters
          ----------
          region : {'Africa', 'Asia', 'Australia', 'North America', 'Oceania', 'South America', 'Antarctica', 'Europe'}string
              Continent name.
          resource : ComplexData:mimetype:`application/x-netcdf`, :mimetype:`application/x-tar`, :mimetype:`application/zip`
              NetCDF Files or archive (tar/zip) containing netCDF files.

          Returns
          -------
          output : ComplexData:mimetype:`application/x-netcdf`
              NetCDF output for first resource file.
          metalink : ComplexData:mimetype:`application/metalink+xml; version=4.0`
              Metalink file with links to all NetCDF outputs.
```
tlvu added a commit to bird-house/finch that referenced this pull request May 27, 2021
Also removed `NBVAL_IGNORE_OUTPUT` since Jenkins is configured to by
default ignore html changes, see PR Ouranosinc/PAVICS-e2e-workflow-tests#73.

To fix this error:
```
  _________ finch-master/docs/source/notebooks/finch-usage.ipynb::Cell 1 _________
  Notebook cell execution failed
  Cell 1: Cell outputs differ

  Input:
  help(wps.frost_days)

  Traceback:
   mismatch 'stdout'

   assert reference_output == test_output failed:

    'Help on meth...ut files.\n\n' == 'Help on meth...ut files.\n\n'
    Skipping 201 identical leading characters in diff, use -v to show
    - iable=None) method of birdy.client.base.WPSClient instance
    + iable=None, output_formats=None) method of birdy.client.base.WPSClient instance
    ?           +++++++++++++++++++++
          Number of days where daily minimum temperatures are below 0.

          Parameters
          ----------
          tasmin : ComplexData:mimetype:`application/x-netcdf`, :mimetype:`application/x-ogc-dods`
              NetCDF Files or archive (tar/zip) containing netCDF files.
          thresh : string
              Freezing temperature.
          freq : {'YS', 'MS', 'QS-DEC', 'AS-JUL'}string
              Resampling frequency.
          check_missing : {'any', 'wmo', 'pct', 'at_least_n', 'skip', 'from_context'}string
              Method used to determine which aggregations should be considered missing.
          missing_options : ComplexData:mimetype:`application/json`
              JSON representation of dictionary of missing method parameters.
          cf_compliance : {'log', 'warn', 'raise'}string
              Whether to log, warn or raise when inputs have non-CF-compliant attributes.
          data_validation : {'log', 'warn', 'raise'}string
              Whether to log, warn or raise when inputs fail data validation checks.
          variable : string
              Name of the variable in the NetCDF file.

          Returns
          -------
          output_netcdf : ComplexData:mimetype:`application/x-netcdf`
              The indicator values computed on the original input grid.
          output_log : ComplexData:mimetype:`text/plain`
              Collected logs during process run.
          ref : ComplexData:mimetype:`application/metalink+xml; version=4.0`
              Metalink file storing all references to output files.
```
tlvu added a commit to bird-house/finch that referenced this pull request Jun 15, 2021
…ut-for-jenkins

finch-usage.ipynb: update output due to new birdy 0.8.0

New birdy removed `output_formats`.

Clarification from DavidH: To clarify, the `output_formats` option still exists, but it's only appearing when the process has a complexoutput supporting more than one data format. 
bird-house/birdy@2bea46c#diff-ba0f245ac7a3747697d42961f7a19568e294dc5d2b4ad14b62a47d8c240ed12eR230-R238

Also removed `NBVAL_IGNORE_OUTPUT` since Jenkins is configured to by
default ignore html changes, see PR Ouranosinc/PAVICS-e2e-workflow-tests#73.

Jenkins passing build with upcoming Jupyter env: http://jenkins.ouranos.ca/job/PAVICS-e2e-workflow-tests/job/new-docker-build-for-ravenpy/10/console

New Jupyter env PR: Ouranosinc/PAVICS-e2e-workflow-tests#75

To fix this error:
```
  _________ finch-master/docs/source/notebooks/finch-usage.ipynb::Cell 1 _________
  Notebook cell execution failed
  Cell 1: Cell outputs differ

  Input:
  help(wps.frost_days)

  Traceback:
   mismatch 'stdout'

   assert reference_output == test_output failed:

    'Help on meth...ut files.\n\n' == 'Help on meth...ut files.\n\n'
    Skipping 201 identical leading characters in diff, use -v to show
    - iable=None) method of birdy.client.base.WPSClient instance
    + iable=None, output_formats=None) method of birdy.client.base.WPSClient instance
    ?           +++++++++++++++++++++
          Number of days where daily minimum temperatures are below 0.

          Parameters
          ----------
          tasmin : ComplexData:mimetype:`application/x-netcdf`, :mimetype:`application/x-ogc-dods`
              NetCDF Files or archive (tar/zip) containing netCDF files.
          thresh : string
              Freezing temperature.
          freq : {'YS', 'MS', 'QS-DEC', 'AS-JUL'}string
              Resampling frequency.
          check_missing : {'any', 'wmo', 'pct', 'at_least_n', 'skip', 'from_context'}string
              Method used to determine which aggregations should be considered missing.
          missing_options : ComplexData:mimetype:`application/json`
              JSON representation of dictionary of missing method parameters.
          cf_compliance : {'log', 'warn', 'raise'}string
              Whether to log, warn or raise when inputs have non-CF-compliant attributes.
          data_validation : {'log', 'warn', 'raise'}string
              Whether to log, warn or raise when inputs fail data validation checks.
          variable : string
              Name of the variable in the NetCDF file.

          Returns
          -------
          output_netcdf : ComplexData:mimetype:`application/x-netcdf`
              The indicator values computed on the original input grid.
          output_log : ComplexData:mimetype:`text/plain`
              Collected logs during process run.
          ref : ComplexData:mimetype:`application/metalink+xml; version=4.0`
              Metalink file storing all references to output files.
```
tlvu added a commit to Ouranosinc/pavics-sdi that referenced this pull request Jun 15, 2021
…t-for-jenkins

subsetting.ipynb: update output due to new birdy 0.8.0

New birdy removed `output_formats`.

Clarification from DavidH: To clarify, the `output_formats` option still exists, but it's only appearing when the process has a complexoutput supporting more than one data format. 
bird-house/birdy@2bea46c#diff-ba0f245ac7a3747697d42961f7a19568e294dc5d2b4ad14b62a47d8c240ed12eR230-R238

Also removed `NBVAL_IGNORE_OUTPUT` since Jenkins is configured to by
default ignore html changes, see PR
Ouranosinc/PAVICS-e2e-workflow-tests#73.

Jenkins passing build with upcoming Jupyter env: http://jenkins.ouranos.ca/job/PAVICS-e2e-workflow-tests/job/new-docker-build-for-ravenpy/10/console

New Jupyter env PR: Ouranosinc/PAVICS-e2e-workflow-tests#75

To fix this error:
```
  _______ pavics-sdi-master/docs/source/notebooks/subsetting.ipynb::Cell 2 _______
  Notebook cell execution failed
  Cell 2: Cell outputs differ

  Input:
  help(fp.subset_continents)

  Traceback:
   mismatch 'stdout'

   assert reference_output == test_output failed:

    'Help on meth... outputs.\n\n' == 'Help on meth... outputs.\n\n'
    Skipping 101 identical leading characters in diff, use -v to show
    - n='Africa') method of birdy.client.base.WPSClient instance
    + n='Africa', output_formats=None) method of birdy.client.base.WPSClient instance
    ?           +++++++++++++++++++++
          Return the data whose grid cells intersect the selected continents for each input dataset.

          Parameters
          ----------
          region : {'Africa', 'Asia', 'Australia', 'North America', 'Oceania', 'South America', 'Antarctica', 'Europe'}string
              Continent name.
          resource : ComplexData:mimetype:`application/x-netcdf`, :mimetype:`application/x-tar`, :mimetype:`application/zip`
              NetCDF Files or archive (tar/zip) containing netCDF files.

          Returns
          -------
          output : ComplexData:mimetype:`application/x-netcdf`
              NetCDF output for first resource file.
          metalink : ComplexData:mimetype:`application/metalink+xml; version=4.0`
              Metalink file with links to all NetCDF outputs.
```
tlvu added a commit to bird-house/finch that referenced this pull request Jun 16, 2021
With PR #188 removing
`NBVAL_IGNORE_OUTPUT` since Jenkins is configured by
default to ignore html changes (PR Ouranosinc/PAVICS-e2e-workflow-tests#73),
test-notebooks target here is broken because it does not have the same
`conftest.py` as Jenkins.

This change brings the same `conftest.py` from Jenkins here to fix
test-notebooks target.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants