Skip to content

Commit

Permalink
final lint and docstring fixes, tests all pass
Browse files Browse the repository at this point in the history
  • Loading branch information
richardarsenault committed Feb 22, 2024
1 parent 86d9fc4 commit 368ed7a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion xhydro/optimal_interpolation/compare_result.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Compare results between simulations and observations."""

import datetime as dt
import pathlib
import sys
from typing import Union

import numpy as np

import datetime as dt
import xhydro.optimal_interpolation.functions.utilities as util
from xhydro.modelling.obj_funcs import get_objective_function

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Empirical Covariance Function climate correction package."""

from functools import partial

import numpy as np
Expand All @@ -7,6 +8,7 @@
from .mathematical_algorithms import calculate_average_distance, eval_covariance_bin
from .utilities import general_ecf, initialize_nan_arrays


def correction(
flow_obs: np.ndarray,
flow_sim: np.ndarray,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Set of mathematical algorithms required for the optimal interpolation."""

import numpy as np


Expand Down
15 changes: 1 addition & 14 deletions xhydro/optimal_interpolation/functions/optimal_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ def initialize_data_arrays(time_range: int, station_count: int) -> tuple[ndarray
drained_area,
)


def retreive_data(args: dict) -> dict[str, Any]:
"""Retrieve data from files to populate the Optimal Interpolation (OI) algorithm.
Expand Down Expand Up @@ -524,20 +525,6 @@ def parallelize_operation(args: dict, parallelize: bool = True) -> np.array:
4. Run pool.map, which maps inputs (iterators) to the function.
5. Collect the results and unzip the tuple returning from pool.map.
6. Close the pool and return the parsed results.
Parameters
----------
args : dict
A dictionary containing the necessary information to retrieve and preprocess data. Keys include 'flow_obs',
'flow_sim', 'start_date', 'end_date', 'time_range', 'stations_info', 'stations_mapping', 'stations_id',
'percentiles' and 'station_count'.
parallelize : bool
Flag to make the code run in parallel. True to use parallelization.
Returns
-------
array-like
Flow quantiles associated to the desired percentiles after optimal interpolation.
"""
station_count = args["station_count"]
percentiles = args["percentiles"]
Expand Down

0 comments on commit 368ed7a

Please sign in to comment.