Skip to content
Merged
Show file tree
Hide file tree
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
19 changes: 7 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
# Use the continuumio/anaconda3 image as a base
# https://hub.docker.com/r/continuumio/anaconda3
FROM continuumio/anaconda3:latest
FROM python:3.12

# Creare maintained
MAINTAINER Creare podpac@creare.com
LABEL org.opencontainers.image.authors="podpac@creare.com"

# Install general tools
RUN apt-get update --yes --quiet && apt-get install --yes --quiet --no-install-recommends \
build-essential \
curl \
unzip \
tar \
wget

# Create a podpac anaconda environment and activate
RUN conda init bash && . ~/.bashrc \
&& conda create --yes --name podpac python=3 anaconda \
&& conda activate podpac

wget && \
apt-get clean
COPY . /opt/podpac
WORKDIR /opt/podpac
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks the old image gets podpac from PYPI, whereas the new version installs it from the local repository. Not sure I really care, just noting the difference.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely! I should've called that out in a commit message or something. I wanted to make sure it built with the very latest code. Of course, now it comes with the prerequisite that you build the dockerfile from within a full checkout of the repo, whereas before you could just build the dockerfile separately if you wanted to.

# Install PODPAC with all dependencies
RUN pip install podpac[all]
RUN pip install .[all]
2 changes: 0 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import os
from shutil import copyfile

# import sys
# sys.path.insert(0, os.path.abspath('.'))
import datetime

# for parsing markdown files
Expand Down
4 changes: 1 addition & 3 deletions podpac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ def makedirs(name, mode=511, exist_ok=False):
try:
_osmakedirs(name, mode)
except OSError as e:
if exist_ok:
pass
else:
if not exist_ok:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's an instance I wholeheartedly agree with!

raise e


Expand Down
1 change: 0 additions & 1 deletion podpac/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ def lazy_module(modname, *args, **kwargs):
plt = lazy_import.lazy_module("matplotlib.pyplot")
np = lazy_import.lazy_module("numpy")
tl = lazy_import.lazy_module("traitlets")
# xr = lazy_import.lazy_module("xarray")
30 changes: 0 additions & 30 deletions podpac/core/algorithm/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,15 +575,6 @@ def reduce(self, x):
UnitsDataArray
Skew of the source data over dims
"""
# N = np.isfinite(x).sum(dim=self._dims)
# M1 = x.mean(dim=self._dims)
# E = x - M1
# E2 = E**2
# E3 = E2*E
# M2 = (E2).sum(dim=self._dims)
# M3 = (E3).sum(dim=self._dims)
# skew = self.skew(M3, M2, N)

a = self._reshape(x)
skew = scipy.stats.skew(a, nan_policy="omit")
return skew
Expand Down Expand Up @@ -660,15 +651,6 @@ def reduce(self, x):
UnitsDataArray
Kurtosis of the source data over dims
"""
# N = np.isfinite(x).sum(dim=self._dims)
# M1 = x.mean(dim=self._dims)
# E = x - M1
# E2 = E**2
# E4 = E2**2
# M2 = (E2).sum(dim=self._dims)
# M4 = (E4).sum(dim=self._dims)
# kurtosis = N * M4 / M2**2 - 3

a = self._reshape(x)
kurtosis = scipy.stats.kurtosis(a, nan_policy="omit")
return kurtosis
Expand Down Expand Up @@ -910,12 +892,6 @@ def _eval(self, coordinates, output=None, _selector=None):
else:
output.data[:] = out.data[:]

## map
# eval_time = xr.DataArray(coordinates.coords["time"])
# E = getattr(eval_time.dt, self.groupby)
# out = out.sel(**{self.groupby: E}).rename({self.groupby: "time"})
# output[:] = out.transpose(*output.dims).data

return output

@tl.default("base_ref")
Expand Down Expand Up @@ -1002,12 +978,6 @@ def _eval(self, coordinates, output=None, _selector=None):
else:
output.data[:] = out.data[:]

## map
# eval_time = xr.DataArray(coordinates.coords["time"])
# E = getattr(eval_time.dt, self.groupby)
# out = out.sel(**{self.groupby: E}).rename({self.groupby: "time"})
# output[:] = out.transpose(*output.dims).data

return output

@tl.default("base_ref")
Expand Down
1 change: 0 additions & 1 deletion podpac/core/cache/s3_cache_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def __init__(self, s3_bucket=None, aws_region_name=None, aws_access_key_id=None,
aws_session = boto3.session.Session(region_name=aws_region_name)
self._s3_client = aws_session.client(
"s3",
# config= boto3.session.Config(signature_version='s3v4'),
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key,
)
Expand Down
12 changes: 6 additions & 6 deletions podpac/core/compositor/test/test_base_compositor.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,33 @@ def test_source_coordinates(self):
assert node.source_coordinates is None

# unstacked
node = BaseCompositor(
BaseCompositor(
sources=[podpac.algorithm.Arange(), podpac.algorithm.SinCoords()],
source_coordinates=podpac.Coordinates([[0, 1]], dims=["time"]),
)

# stacked
node = BaseCompositor(
BaseCompositor(
sources=[podpac.algorithm.Arange(), podpac.algorithm.SinCoords()],
source_coordinates=podpac.Coordinates([[[0, 1], [10, 20]]], dims=["time_alt"]),
)

# invalid size
with pytest.raises(ValueError, match="Invalid source_coordinates, source and source_coordinates size mismatch"):
node = BaseCompositor(
BaseCompositor(
sources=[podpac.algorithm.Arange(), podpac.algorithm.SinCoords()],
source_coordinates=podpac.Coordinates([[0, 1, 2]], dims=["time"]),
)

with pytest.raises(ValueError, match="Invalid source_coordinates, source and source_coordinates size mismatch"):
node = BaseCompositor(
BaseCompositor(
sources=[podpac.algorithm.Arange(), podpac.algorithm.SinCoords()],
source_coordinates=podpac.Coordinates([[0, 1, 2]], dims=["time"]),
)

# invalid ndims
with pytest.raises(ValueError, match="Invalid source_coordinates"):
node = BaseCompositor(
BaseCompositor(
sources=[podpac.algorithm.Arange(), podpac.algorithm.SinCoords()],
source_coordinates=podpac.Coordinates([[0, 1], [10, 20]], dims=["time", "alt"]),
)
Expand Down Expand Up @@ -252,7 +252,7 @@ def test_auto_outputs(self):

# mixed
with pytest.raises(ValueError, match="Cannot composite standard sources with multi-output sources."):
node = BaseCompositor(sources=[MULTI_2_X, ARRAY_LAT], auto_outputs=True)
BaseCompositor(sources=[MULTI_2_X, ARRAY_LAT], auto_outputs=True)

# no sources
node = BaseCompositor(sources=[], auto_outputs=True)
Expand Down
7 changes: 2 additions & 5 deletions podpac/core/coordinates/array_coordinates1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,15 @@ def __init__(self, coordinates, name=None, **kwargs):
self.not_a_trait = coordinates

# precalculate once
if self.coordinates.size == 0:
pass

elif self.coordinates.size == 1:
if self.coordinates.size == 1:
self._is_monotonic = True

elif self.coordinates.ndim > 1:
self._is_monotonic = None
self._is_descending = None
self._is_uniform = None

else:
elif self.coordinates.size != 0:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally find the if - pass more readable in this case... but oh well.

deltas = self.deltas
if np.any(deltas <= 0):
self._is_monotonic = False
Expand Down
16 changes: 7 additions & 9 deletions podpac/core/coordinates/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,14 +653,13 @@ def __getitem__(self, index):

def __setitem__(self, dim, c):
# coerce
if isinstance(c, BaseCoordinates):
pass
elif isinstance(c, Coordinates):
c = c[dim]
elif "_" in dim:
c = StackedCoordinates(c)
else:
c = ArrayCoordinates1d(c)
if not isinstance(c, BaseCoordinates):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh interesting... in this case disallowing 'pass' creates an extra nest -- interesting.

if isinstance(c, Coordinates):
c = c[dim]
elif "_" in dim:
c = StackedCoordinates(c)
else:
c = ArrayCoordinates1d(c)

c._set_name(dim)

Expand Down Expand Up @@ -937,7 +936,6 @@ def geotransform(self):
"{} do not.".format(self)
)
if self.udims.index("lon") < self.udims.index("lat"):
# transform = (transform[3], transform[5], transform[4], transform[0], transform[2], transform[1])
transform = transform[3:] + transform[:3]

return transform
Expand Down
14 changes: 0 additions & 14 deletions podpac/core/coordinates/polar_coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,3 @@ def full_definition(self):

def copy(self):
return PolarCoordinates(self.center, self.radius, self.theta, dims=self.dims)

# TODO return PolarCoordinates when possible
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally dislike getting rid of TODOs -- this is probably a great hint for some feature we didn't have time to implement but thought about when this was written... I suppose it's old enough that it no longer serves as a hint. Don't mind me, I'm just ranting today.

# def select(self, other, outer=False):
# raise NotImplementedError("TODO")

# ------------------------------------------------------------------------------------------------------------------
# Debug
# ------------------------------------------------------------------------------------------------------------------

# def plot(self, marker='b.', center_marker='bx'):
# from matplotlib import pyplot
# super(PolarCoordinates, self).plot(marker=marker)
# cx, cy = self.center
# pyplot.plot(cx, cy, center_marker)
Loading
Loading