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

Remove unused function #9061

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Changes from all commits
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
25 changes: 1 addition & 24 deletions src/ert/dark_storage/common.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import contextlib
from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, Tuple, Union
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple
from uuid import UUID

import numpy as np
Expand Down Expand Up @@ -73,12 +73,6 @@ def ensemble_parameters(storage: Storage, ensemble_id: UUID) -> List[Dict[str, A
return param_list


def get_response_names(ensemble: Ensemble) -> List[str]:
result = ensemble.get_summary_keyset()
result.extend(sorted(gen_data_keys(ensemble), key=lambda k: k.lower()))
return result


def gen_data_keys(ensemble: Ensemble) -> Iterator[str]:
gen_data_config = ensemble.experiment.response_configuration.get("gen_data")

Expand Down Expand Up @@ -283,20 +277,3 @@ def get_observation_keys_for_response(
return filtered["observation_key"].unique().to_list()

return []


def _prepare_x_axis(
x_axis: Sequence[Union[int, float, str, pd.Timestamp]],
) -> List[str]:
"""Converts the elements of x_axis of an observation to a string suitable
for json. If the elements are timestamps, convert to ISO-8601 format.

>>> _prepare_x_axis([1, 2, 3, 4])
['1', '2', '3', '4']
>>> _prepare_x_axis([pd.Timestamp(x, unit="d") for x in range(3)])
['1970-01-01T00:00:00', '1970-01-02T00:00:00', '1970-01-03T00:00:00']
"""
if isinstance(x_axis[0], pd.Timestamp):
return [pd.Timestamp(x).isoformat() for x in x_axis]

return [str(x) for x in x_axis]