Skip to content

Commit

Permalink
Remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindeide committed Oct 28, 2024
1 parent 9817d75 commit 6b436e7
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 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 @@ -283,20 +283,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]

0 comments on commit 6b436e7

Please sign in to comment.