Skip to content

Commit

Permalink
Merge 1d7600d into 76fc2db
Browse files Browse the repository at this point in the history
  • Loading branch information
mlshapiro committed Apr 7, 2020
2 parents 76fc2db + 1d7600d commit c2d2d59
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 10 deletions.
8 changes: 4 additions & 4 deletions doc/source/conf.py
Expand Up @@ -227,7 +227,7 @@ def generate_example_links():
prestring = "- "
string = "\n".join(
[
prestring + " `{} <{}>`__".format(f, base_link + "/" + f)
prestring + " `{} <{}>`_".format(f.split('.ipynb')[0].replace('-', ' ').capitalize(), base_link + "/" + f)
for f in files
if f.endswith("ipynb")
]
Expand All @@ -237,19 +237,19 @@ def generate_example_links():
f
for f in files
if os.path.isdir(os.path.join(nbpath, f))
and f not in [".ipynb_checkpoints", "Images", "old_examples", "presentations"]
and f not in [".ipynb_checkpoints", "developer", "__pycache__"]
]
subdirs.sort()
for sd in subdirs:
path = os.path.join(nbpath, sd)
link = base_link + "/" + sd
fs = os.listdir(path)
fs.sort()
string += "\n- {}\n".format(sd)
string += "\n- {}\n".format(sd.replace('-', ' ').title())
prestring = " -"
string += "\n".join(
[
prestring + " `{} <{}>`__".format(f, link + "/" + f)
prestring + " `{} <{}>`_".format(f.split('.ipynb')[0].replace('-', ' ').capitalize(), link + "/" + f)
for f in fs
if f.endswith("ipynb")
]
Expand Down
2 changes: 1 addition & 1 deletion doc/source/examples.rst
Expand Up @@ -140,7 +140,7 @@ configured.
output = node.eval(coords)
`Notebooks <https://github.com/creare-com/podpac_examples/tree/master/notebooks>`__
Notebooks
---------

Interactive PODPAC examples are distributed as `example Jupyter
Expand Down
13 changes: 13 additions & 0 deletions podpac/core/data/array_source.py
Expand Up @@ -52,6 +52,8 @@ class Array(NoCacheMixin, DataSource):
source = ArrayTrait().tag(attr=True)
native_coordinates = tl.Instance(Coordinates).tag(attr=True)

_repr_keys = ["shape", "interpolation"]

@tl.validate("source")
def _validate_source(self, d):
try:
Expand All @@ -69,6 +71,17 @@ def _first_init(self, **kwargs):

return kwargs

@property
def shape(self):
"""Returns the shape of :attr:`self.source`
Returns
-------
tuple
Shape of :attr:`self.source`
"""
return self.source.shape

@common_doc(COMMON_DATA_DOC)
def get_data(self, coordinates, coordinates_index):
"""{get_data}
Expand Down
4 changes: 2 additions & 2 deletions podpac/core/data/file_source.py
Expand Up @@ -49,7 +49,7 @@ class BaseFileSource(DataSource):
source = tl.Unicode().tag(attr=True)

# list of attribute names, used by __repr__ and __str__ to display minimal info about the node
_repr_keys = ["source"]
_repr_keys = ["source", "interpolation"]

@tl.default("source")
def _default_source(self):
Expand Down Expand Up @@ -159,7 +159,7 @@ class FileKeysMixin(tl.HasTraits):
@property
def _repr_keys(self):
""" list of attribute names, used by __repr__ and __str__ to display minimal info about the node"""
keys = ["source"]
keys = ["source", "interpolation"]
if len(self.available_data_keys) > 1 and not isinstance(self.data_key, list):
keys.append("data_key")
return keys
Expand Down
2 changes: 1 addition & 1 deletion podpac/core/data/ogc.py
Expand Up @@ -57,7 +57,7 @@ class WCS(DataSource):
crs = tl.Unicode(default_value=WCS_DEFAULT_CRS).tag(attr=True)

# list of attribute names, used by __repr__ and __str__ to display minimal info about the node
_repr_keys = ["source"]
_repr_keys = ["source", "interpolation"]

_get_capabilities_qs = tl.Unicode("SERVICE=WCS&REQUEST=DescribeCoverage&" "VERSION={version}&COVERAGE={layer}")
_get_data_qs = tl.Unicode(
Expand Down
2 changes: 1 addition & 1 deletion podpac/core/data/pydap_source.py
Expand Up @@ -48,7 +48,7 @@ class PyDAP(authentication.RequestsSessionMixin, DataSource):
data_key = tl.Unicode().tag(attr=True)

# list of attribute names, used by __repr__ and __str__ to display minimal info about the node
_repr_keys = ["source"]
_repr_keys = ["source", "interpolation"]

# hostname for RequestsSession is source. Try parsing off netloc
@tl.default("hostname")
Expand Down
2 changes: 1 addition & 1 deletion podpac/core/data/reprojection.py
Expand Up @@ -34,7 +34,7 @@ class ReprojectedSource(DataSource):
reprojected_coordinates = tl.Instance(Coordinates).tag(attr=True)

# list of attribute names, used by __repr__ and __str__ to display minimal info about the node
_repr_keys = ["source"]
_repr_keys = ["source", "interpolation"]

def _first_init(self, **kwargs):
if "reprojected_coordinates" in kwargs:
Expand Down

0 comments on commit c2d2d59

Please sign in to comment.