Skip to content

Commit

Permalink
Merge pull request #491 from metno/main-dev
Browse files Browse the repository at this point in the history
Version 0.12.1
  • Loading branch information
jgliss authored Oct 14, 2021
2 parents f30d1a2 + ce55cdb commit 571eab9
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 11 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ include README.rst
include VERSION.md
include pyaerocom_env.yml
include pytest.ini
recursive-include tests/ *
2 changes: 1 addition & 1 deletion VERSION.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12.0
0.12.1
2 changes: 1 addition & 1 deletion pyaerocom/ungriddeddata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ def check_unit(self, var_name, unit=None):
raise MetaDataError(
f'Invalid unit {u} detected (expected {unit})')

def set_flags_nan(self, inplace=False, verbose=False):
def set_flags_nan(self, inplace=False):
"""Set all flagged datapoints to NaN
Parameters
Expand Down
2 changes: 2 additions & 0 deletions tests/aeroval/test_aeroval_HIGHLEV.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
import os, glob
from ..conftest import geojson_unavail
from pyaerocom.aeroval import ExperimentProcessor
from pyaerocom.aeroval.setupclasses import EvalSetup
from .cfg_test_exp1 import CFG as cfgexp1
Expand Down Expand Up @@ -40,6 +41,7 @@
'ts/diurnal': 0 # number of .json files in subdir
}

@geojson_unavail
@pytest.mark.parametrize('cfgdict,chk_files',[
(cfgexp1,CHK_CFG1),
(cfgexp2,CHK_CFG2),
Expand Down
5 changes: 4 additions & 1 deletion tests/aeroval/test_experiment_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pyaerocom._lowlevel_helpers import read_json,write_json
from pyaerocom.aeroval import experiment_output as mod, ExperimentProcessor
from pyaerocom.aeroval.setupclasses import EvalSetup
from ..conftest import does_not_raise_exception
from ..conftest import does_not_raise_exception, geojson_unavail
from .cfg_test_exp1 import CFG as cfgexp1
BASEDIR_DEFAULT = os.path.join(const.OUTPUTDIR, 'aeroval/data')
from ._outbase import AEROVAL_OUT as BASEOUT
Expand Down Expand Up @@ -203,13 +203,15 @@ def test_ExperimentOutput_delete_experiment_data_CFG1():
proc.exp_output.delete_experiment_data()
assert not os.path.exists(chk)

@geojson_unavail
def test_Experiment_Output_clean_json_files_CFG1():
cfg = EvalSetup(**cfgexp1)
proc = ExperimentProcessor(cfg)
proc.run()
modified = proc.exp_output.clean_json_files()
assert len(modified) == 0

@geojson_unavail
def test_Experiment_Output_clean_json_files_CFG1_INVALIDMOD():
cfg = EvalSetup(**cfgexp1)
cfg.model_cfg['mod1'] = cfg.model_cfg['TM5-AP3-CTRL']
Expand All @@ -219,6 +221,7 @@ def test_Experiment_Output_clean_json_files_CFG1_INVALIDMOD():
modified = proc.exp_output.clean_json_files()
assert len(modified) == 15

@geojson_unavail
def test_Experiment_Output_clean_json_files_CFG1_INVALIDOBS():
cfg = EvalSetup(**cfgexp1)
cfg.obs_cfg['obs1'] = cfg.obs_cfg['AERONET-Sun']
Expand Down
4 changes: 3 additions & 1 deletion tests/aeroval/test_experiment_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
from .cfg_test_exp3 import CFG as cfgexp3
from .cfg_test_exp4 import CFG as cfgexp4
from .cfg_test_exp5 import CFG as cfgexp5
from ..conftest import does_not_raise_exception
from ..conftest import does_not_raise_exception, geojson_unavail


@pytest.mark.parametrize('cfgdict,raises', [
(cfgexp1,does_not_raise_exception())
Expand All @@ -21,6 +22,7 @@ def test_ExperimentProcessor___init__(cfgdict,raises):
assert isinstance(proc.cfg, EvalSetup)
assert isinstance(proc.exp_output, ExperimentOutput)

@geojson_unavail
@pytest.mark.parametrize('cfgdict,runkwargs,raises', [
(cfgexp5,{},does_not_raise_exception()),
(cfgexp1,{},does_not_raise_exception()),
Expand Down
9 changes: 9 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@
data_unavail = pytest.mark.skipif(not TESTDATA_AVAIL,
reason='Skipping tests that require testdata-minimal.')

try:
import geojsoncontour
geojson_avail = True
except ModuleNotFoundError:
geojson_avail = False

geojson_unavail = pytest.mark.skipif(not geojson_avail,
reason='Skipping tests that require access geojsoncontour')

broken_test = pytest.mark.skip(reason='Method raises Exception')

from pyaerocom import change_verbosity
Expand Down
7 changes: 0 additions & 7 deletions tests/test_geodesy.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 4 10:36:15 2019
@author: jonasg
"""
import numpy.testing as npt
import pytest

Expand Down

0 comments on commit 571eab9

Please sign in to comment.