Skip to content
Open
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
35 changes: 35 additions & 0 deletions doc/source/api-scheme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# API Scheme
A naming scheme for our API. The goal is to make the grammar of the entire API consistent.

## Rules

### Node Rules
All node names must be:
1. Nouns
2. Singular

### Implementation File Riles
All implementation file names must be:
1. Nouns
2. Singular

### Coordinates Rules
All Coordinates names must be:
1. Nouns

### Core Directory Rules
Where a "Core Directory" is located inside podpac/core/*
All directory names must be:
1. Nouns
2. Plural


### Package Rules:

Where a "Package" is loaded by podpac.*

All package names must be:
1. Nouns
2. Plural
*AND*
3. All packages must match their corresponding `podpac.core.*` directory name.
50 changes: 25 additions & 25 deletions doc/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,56 +119,56 @@ Split/Apply/Combine nodes with algorithms
:toctree: api/
:template: class.rst

podpac.algorithm.Algorithm
podpac.algorithms.Algorithm

.. rubric:: General Purpose

.. autosummary::
:toctree: api/
:template: class.rst

podpac.algorithm.Arithmetic
podpac.algorithm.SinCoords
podpac.algorithm.Arange
podpac.algorithm.CoordData
podpac.algorithms.Arithmetic
podpac.algorithms.SinCoords
podpac.algorithms.Arange
podpac.algorithms.CoordData

.. rubric:: Statistical Methods

.. autosummary::
:toctree: api/
:template: class.rst

podpac.algorithm.Min
podpac.algorithm.Max
podpac.algorithm.Sum
podpac.algorithm.Count
podpac.algorithm.Mean
podpac.algorithm.Median
podpac.algorithm.Variance
podpac.algorithm.StandardDeviation
podpac.algorithm.Skew
podpac.algorithm.Kurtosis
podpac.algorithm.DayOfYear
podpac.algorithm.GroupReduce
podpac.algorithms.Min
podpac.algorithms.Max
podpac.algorithms.Sum
podpac.algorithms.Count
podpac.algorithms.Mean
podpac.algorithms.Median
podpac.algorithms.Variance
podpac.algorithms.StandardDeviation
podpac.algorithms.Skew
podpac.algorithms.Kurtosis
podpac.algorithms.DayOfYear
podpac.algorithms.GroupReduce

.. rubric:: Coordinates Modification

.. autosummary::
:toctree: api/
:template: class.rst

podpac.algorithm.ExpandCoordinates
podpac.algorithm.SelectCoordinates
podpac.algorithms.CoordinatesExpander
podpac.algorithms.CoordinatesSelector

.. rubric:: Signal Processing

.. autosummary::
:toctree: api/
:template: class.rst

podpac.algorithm.Convolution
podpac.algorithm.SpatialConvolution
podpac.algorithm.TimeConvolution
podpac.algorithms.Convolution
podpac.algorithms.SpatialConvolution
podpac.algorithms.TimeConvolution

Compositor Nodes
----------------
Expand All @@ -179,9 +179,9 @@ Stitch multiple data sources together
:toctree: api/
:template: class.rst

podpac.compositor.OrderedCompositor
podpac.compositor.UniformTileCompositor
podpac.compositor.UniformTileMixin
podpac.compositors.OrderedCompositor
podpac.compositors.UniformTileCompositor
podpac.compositors.UniformTileMixin


Datalib
Expand Down
2 changes: 1 addition & 1 deletion doc/source/nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ Additional properties and examples for each of the core node types are provided

* The `node` path should include the submodule path and the node class. The submodule path is omitted for top-level classes. For example:
- `"node": "datalib.smap.SMAP"` is equivalent to `from podpac.datalib.smap import SMAP`.
- `"node": "compositor.OrderedCompositor"` is equivalent to `from podpac.compositor import OrderedCompositor`.
- `"node": "compositor.OrderedCompositor"` is equivalent to `from podpac.compositorsimport OrderedCompositor`.
* The `plugin` path replaces 'podpac' in the full node path. For example
- `"plugin": "path.to.myplugin", "node": "mymodule.MyCustomNode"` is equivalent to `from path.to.myplugin.mymodule import MyCustomNode`.
- `"plugin": "myplugin", "node": "MyCustomNode"` is equivalent to `from myplugin import MyCustomNode`
4 changes: 2 additions & 2 deletions doc/source/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ nodeA = podpac.data.Rasterio(source="elevation.tif", interpolation="cubic")
nodeB = podpac.datalib.TerrainTiles(tile_format='geotiff', zoom=8)

# average the two data sources together point-wise
alg_node = podpac.algorithm.Arithmetic(A=nodeA, B=nodeB, eqn='(A + B) / 2')
alg_node = podpac.algorithms.Arithmetic(A=nodeA, B=nodeB, eqn='(A + B) / 2')
```

Evaluate pipelines at arbitrary PODPAC coordinates.
Expand Down Expand Up @@ -142,7 +142,7 @@ settings["AWS_ACCESS_KEY_ID"] = "access key id"
settings["AWS_SECRET_ACCESS_KEY"] = "secrect access key"

# create example data source node and AWS node
node = podpac.algorithm.SinCoords()
node = podpac.algorithms.SinCoords()
aws_node = podpac.managers.aws.Lambda(source=node)

# build AWS cloud resources to run analysis
Expand Down
2 changes: 1 addition & 1 deletion doc/source/wrapping-datasets.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ In theory, to wrap a new `DataSource`:
1. `coordinates` is a `podpac.Coordinates` object and it's in the same coordinate system as the data source (i.e. a subset of what comes out of `get_coordinates`)
2. `coordinates_index` is a list (or tuple?) of slices or boolean arrays or index arrays to indexes into the output of `get_coordinates()` to produce `coordinates` that come into this function.

In practice, the real trick is implementing a compositor to put multiple tiles together to look like a single `DataSource`. We tend to use the `podpac.compositor.OrderedCompositor` node for this task, but it does not handle interpolation between tiles. Instead, see the `podpac.core.compositor.tile_compositor` module.
In practice, the real trick is implementing a compositor to put multiple tiles together to look like a single `DataSource`. We tend to use the `podpac.compositors.OrderedCompositor` node for this task, but it does not handle interpolation between tiles. Instead, see the `podpac.core.compositors.tile_compositor` module.

When using compositors, it is prefered the that `sources` attribute is populated at instantiation, but on-the-fly (i.e. at eval) population of sources is also acceptible and sometimes necessary for certain datasources.

Expand Down
4 changes: 2 additions & 2 deletions podpac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ def makedirs(name, mode=511, exist_ok=False):

# Organized submodules
# These files are simply wrappers to create a curated namespace of podpac modules
from podpac import algorithm
from podpac import algorithms
from podpac import authentication
from podpac import data
from podpac import interpolators
from podpac import coordinates
from podpac import compositor
from podpac import compositors
from podpac import managers
from podpac import utils
from podpac import style
Expand Down
2 changes: 1 addition & 1 deletion podpac/alglib/climatology.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# Internal dependencies
import podpac
from podpac.core.algorithm.stats import DayOfYearWindow
from podpac.core.algorithms.stats import DayOfYearWindow

# Set up logging
_log = logging.getLogger(__name__)
Expand Down
33 changes: 0 additions & 33 deletions podpac/algorithm.py

This file was deleted.

33 changes: 33 additions & 0 deletions podpac/algorithms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""
Algorithm Public Module
"""

# REMINDER: update api docs (doc/source/user/api.rst) to reflect changes to this file

from podpac.core.algorithms.algorithm import Algorithm, UnaryAlgorithm
from podpac.core.algorithms.generic import Arithmetic, Generic, Mask
from podpac.core.algorithms.utility import SinCoords, Arange, CoordData
from podpac.core.algorithms.stats import (
Min,
Max,
Sum,
Count,
Mean,
Median,
Variance,
StandardDeviation,
Skew,
Percentile,
Kurtosis,
DayOfYear,
GroupReduce,
ResampleReduce,
)
from podpac.core.algorithms.coord_select import (
CoordinatesExpander,
CoordinatesSelector,
YearSubstituteCoordinates,
TransformTimeUnits,
)
from podpac.core.algorithms.signal import Convolution
from podpac.core.algorithms.reprojection import Reproject
8 changes: 0 additions & 8 deletions podpac/compositor.py

This file was deleted.

8 changes: 8 additions & 0 deletions podpac/compositors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""
Compositor Public Module
"""

# REMINDER: update api docs (doc/source/user/api.rst) to reflect changes to this file

from podpac.core.compositors.ordered_compositor import OrderedCompositor
from podpac.core.compositors.tile_compositor import TileCompositor, TileCompositorRaw
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from podpac.core.coordinates import UniformCoordinates1d, ArrayCoordinates1d
from podpac.core.coordinates import make_coord_value, make_coord_delta, add_coord
from podpac.core.node import Node, COMMON_NODE_DOC
from podpac.core.algorithm.algorithm import UnaryAlgorithm
from podpac.core.algorithms.algorithm import UnaryAlgorithm
from podpac.core.utils import common_doc, NodeTrait

COMMON_DOC = COMMON_NODE_DOC.copy()
Expand Down Expand Up @@ -99,7 +99,7 @@ def _eval(self, coordinates, output=None, _selector=None):
return output


class ExpandCoordinates(ModifyCoordinates):
class CoordinatesExpander(ModifyCoordinates):
"""Evaluate a source node with expanded coordinates.

This is normally used in conjunction with a reduce operation
Expand Down Expand Up @@ -185,7 +185,7 @@ def get_modified_coordinates1d(self, coords, dim):
return ArrayCoordinates1d(np.concatenate([c.coordinates for c in cs]), **coords1d.properties)


class SelectCoordinates(ModifyCoordinates):
class CoordinatesSelector(ModifyCoordinates):
"""Evaluate a source node with select coordinates.

While this is simple to do when
Expand Down Expand Up @@ -234,7 +234,7 @@ def get_modified_coordinates1d(self, coords, dim):
available_coordinates = self.coordinates_source.find_coordinates()
if len(available_coordinates) != 1:
raise ValueError(
"SelectCoordinates Node cannot determine the step size between bounds for dimension"
"CoordinatesSelector Node cannot determine the step size between bounds for dimension"
+ "{} because source node (source.find_coordinates()) has {} different coordinates.".format(
dim, len(available_coordinates)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from podpac import Coordinates
from podpac.core.node import Node, NodeException
from podpac.core.utils import NodeTrait
from podpac.core.algorithm.algorithm import Algorithm
from podpac.core.algorithms.algorithm import Algorithm

if sys.version_info.major == 2:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Internal dependencies
from podpac.core.node import Node
from podpac.core.coordinates.coordinates import Coordinates, merge_dims
from podpac.core.interpolation.interpolation import Interpolate
from podpac.core.interpolators.interpolation import Interpolate
from podpac.core.utils import NodeTrait, cached_property
from podpac import settings

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from podpac.core.coordinates import Coordinates, UniformCoordinates1d, ArrayCoordinates1d
from podpac.core.coordinates import add_coord
from podpac.core.node import Node
from podpac.core.algorithm.algorithm import UnaryAlgorithm
from podpac.core.algorithms.algorithm import UnaryAlgorithm
from podpac.core.utils import common_doc, ArrayTrait, NodeTrait
from podpac.core.node import COMMON_NODE_DOC

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import podpac
from podpac.core.coordinates import Coordinates
from podpac.core.node import Node
from podpac.core.algorithm.algorithm import UnaryAlgorithm, Algorithm
from podpac.core.algorithms.algorithm import UnaryAlgorithm, Algorithm
from podpac.core.utils import common_doc, NodeTrait
from podpac.core.node import COMMON_NODE_DOC

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import xarray as xr

import podpac
from podpac.core.algorithm.algorithm import BaseAlgorithm, Algorithm, UnaryAlgorithm
from podpac.core.algorithms.algorithm import BaseAlgorithm, Algorithm, UnaryAlgorithm


class TestBaseAlgorithm(object):
Expand Down
Loading