Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11.0
python-version: 3.10.8
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
channels: conda-forge
channel-priority: flexible
show-channel-urls: true
- name: Create env from unpinned reqs
- name: Create env from pinned environment
run: |
conda env create --name dev_env --file requirements/requirements.yml
conda env create --name dev_env --file requirements/environment.yml
- name: Install pre-commit hooks
run: |
conda run --name dev_env pre-commit install-hooks
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11.0
python-version: 3.10.8
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
channels: conda-forge
channel-priority: flexible
show-channel-urls: true
- name: Create dev env from unpinned reqs
- name: Create env from pinned environment
run: |
conda env create --name dev_env --file requirements/requirements.yml
./setup_env.sh -n probtest
- name: Run Pytest
env:
TZ: Europe/Zurich
run: |
conda run --name dev_env pytest -v -s --cov --cov-report=term tests/
conda run --name probtest pytest -v -s --cov --cov-report=term tests/
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.idea*
.vscode/*
!.vscode/settings.json
.vscode
*pycache*
*.swp
*.pdf
Expand All @@ -9,6 +8,7 @@
*.nc
.coverage
coverage.xml
miniconda

# output from unittest
test_stats.csv
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ setup scripts:

```console
./setup_miniconda.sh
./setup_env.sh -n probtest -u
source miniconda/bin/activate
./setup_env.sh
```

#### Initialize probtest
Expand Down
4 changes: 2 additions & 2 deletions engine/cdo_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def rel_diff_stats(
horizontal_dims,
xarray_ds,
fill_value_key,
): # pylint: disable=unused-argument
): # pylint: disable=unused-argument, too-many-positional-arguments
dims = xarray_ds[varname].dims
dataarray = xarray_ds[varname]
time = xarray_ds[time_dim].values
Expand Down Expand Up @@ -125,7 +125,7 @@ def cdo_table(
perturbed_model_output_dir,
cdo_table_file,
file_specification,
):
): # pylint: disable=too-many-positional-arguments
# TODO: A single perturbed run provides enough data to make proper statistics.
# refactor cdo_table interface to reflect that
if len(member_num) == 1:
Expand Down
2 changes: 1 addition & 1 deletion engine/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def init(
timing_current,
timing_reference,
append_time,
):
): # pylint: disable=too-many-positional-arguments
template_partition = str(template_name).rpartition("/")
env = Environment(
loader=FileSystemLoader(template_partition[0]), undefined=StrictUndefined
Expand Down
2 changes: 1 addition & 1 deletion engine/performance_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def performance_check(
measurement_uncertainty,
tolerance_factor,
new_reference_threshold,
):
): # pylint: disable=too-many-positional-arguments
ttcur = TimingTree.from_json(timing_current)
ttref = TimingTree.from_json(timing_reference)

Expand Down
2 changes: 1 addition & 1 deletion engine/perturb.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def perturb(
variable_names,
perturb_amplitude,
copy_all_files,
): # pylint: disable=unused-argument
): # pylint: disable=unused-argument, too-many-positional-arguments

processed_member_num = process_member_num(member_num)

Expand Down
4 changes: 2 additions & 2 deletions engine/run_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def prepare_perturbed_run_script(
rhs_new,
rhs_old,
seed,
):
): # pylint: disable=too-many-positional-arguments
with open(runscript, "r", encoding="utf-8") as in_file:
with open(perturbed_runscript, "w", encoding="utf-8") as out_file:

Expand Down Expand Up @@ -222,7 +222,7 @@ def run_ensemble(
lhs,
rhs_new,
rhs_old,
):
): # pylint: disable=too-many-positional-arguments
perturbed_run_dir = perturbed_run_dir if perturbed_run_dir else run_dir
os.chdir(run_dir)
job_list = []
Expand Down
4 changes: 2 additions & 2 deletions engine/select_members.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def find_members_and_factor_validating_for_all_stats_files(
min_factor,
max_factor,
iterations,
):
): # pylint: disable=too-many-positional-arguments

members = list(range(1, total_member_num + 1))

Expand Down Expand Up @@ -263,7 +263,7 @@ def select_members(
min_factor,
max_factor,
iterations,
): # pylint: disable=unused-argument
): # pylint: disable=unused-argument, too-many-positional-arguments

if min_member_num > max_member_num:
logger.error(
Expand Down
4 changes: 2 additions & 2 deletions engine/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def process_member(
file_id,
stats_file_name,
file_specification,
):
): # pylint: disable=too-many-positional-arguments
if m_num == 0:
input_dir = model_output_dir
m_id = "ref"
Expand Down Expand Up @@ -110,7 +110,7 @@ def stats(
member_type,
perturbed_model_output_dir,
file_specification,
):
): # pylint: disable=too-many-positional-arguments
file_specification = file_specification[0] # can't store dicts as defaults in click
assert isinstance(file_specification, dict), "must be dict"

Expand Down
Loading
Loading