Skip to content

Commit

Permalink
Rename image class
Browse files Browse the repository at this point in the history
  • Loading branch information
wpreimes committed Aug 2, 2023
1 parent c5f44f2 commit 2f1a45b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/repurpose/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"""


class RegularImageStack:
class Regular3dimImageStack:

def __init__(self,
grid,
Expand Down
8 changes: 4 additions & 4 deletions src/repurpose/ts2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from datetime import datetime
import warnings

from repurpose.image import RegularImageStack
from repurpose.stack import Regular3dimImageStack

"""
TODOs:
Expand All @@ -25,7 +25,7 @@
"""

def _convert(converter: 'Ts2Img',
writer: RegularImageStack,
writer: Regular3dimImageStack,
img_gpis: np.ndarray,
lons: np.ndarray,
lats: np.ndarray) -> xr.Dataset:
Expand Down Expand Up @@ -139,7 +139,7 @@ def __init__(self, ts_reader, img_grid, timestamps,
max_dist=18000, time_collocation=True):

self.ts_reader = ts_reader
self.img_grid: CellGrid = RegularImageStack._eval_grid(img_grid)
self.img_grid: CellGrid = Regular3dimImageStack._eval_grid(img_grid)
self.timestamps = timestamps

if variables is not None:
Expand All @@ -166,7 +166,7 @@ def _cell_writer(self, cell: int, timestamps_chunk: pd.DatetimeIndex):
n_lons = np.unique(cellgrid.activearrlon).size
cellgrid.shape = (n_lats, n_lons)

writer = RegularImageStack(
writer = Regular3dimImageStack(
cellgrid, timestamps=timestamps_chunk, zlib=False,
time_collocation=self.time_collocation)

Expand Down
6 changes: 3 additions & 3 deletions tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import unittest
import os
import pandas as pd
from repurpose.image import RegularImageStack
from repurpose.stack import Regular3dimImageStack
import tempfile
import pytest
import xarray as xr
Expand All @@ -19,7 +19,7 @@ class TestRegularImageStackNoCollocation(unittest.TestCase):
"""
def setUp(self) -> None:
self.timestamps = pd.date_range('2020-01-01', '2020-01-02', freq='6H')
self.writer = RegularImageStack.from_genreg(
self.writer = Regular3dimImageStack.from_genreg(
resolution=0.25, extent=bbox_spain, timestamps=self.timestamps,
time_collocation=False, reference_time="1900-01-01T00:00:00",
zlib=True)
Expand Down Expand Up @@ -133,7 +133,7 @@ def setUp(self) -> None:
grid_spain.shape = (np.unique(grid_spain.activearrlat).size,
np.unique(grid_spain.activearrlon).size)

self.writer = RegularImageStack(
self.writer = Regular3dimImageStack(
grid=grid_spain, timestamps=self.img_timestamps, time_collocation=True,
reference_time="1900-01-01T00:00:00", zlib=True)

Expand Down

0 comments on commit 2f1a45b

Please sign in to comment.