-
Notifications
You must be signed in to change notification settings - Fork 6
Fix sonarqube findings #552
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
Changes from all commits
e2d2259
82bc8e1
7611767
19ccc74
bc2c2a5
19828fb
dd61915
81befed
c979d36
37c584c
38f6a2c
1452ed1
65f77b4
dc882b6
214cabc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
| # Install PODPAC with all dependencies | ||
| RUN pip install podpac[all] | ||
| RUN pip install .[all] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's an instance I wholeheartedly agree with! |
||
| raise e | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
|
||
|
|
@@ -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 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.