def lazily_class(name):
    module = lazy.lazy_class(name)
    try:
        get_ipython().magic('aimport -%s' % name)
        print('Not autoreload %s' % name)
    except:
        pass
    return module
Exemple #2
0
# coding: utf-8
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.

from __future__ import absolute_import

import lazy_import as _lazy_import

MultipartObjectAssembler = _lazy_import.lazy_class(
    "oci.object_storage.transfer.internal.multipart_object_assembler.MultipartObjectAssembler"
)
models = _lazy_import.lazy_module("oci.object_storage.models")
ObjectStorageClient = _lazy_import.lazy_class(
    "oci.object_storage.object_storage_client.ObjectStorageClient")
ObjectStorageClientCompositeOperations = _lazy_import.lazy_class(
    "oci.object_storage.object_storage_client_composite_operations.ObjectStorageClientCompositeOperations"
)
UploadManager = _lazy_import.lazy_class(
    "oci.object_storage.transfer.upload_manager.UploadManager")

__all__ = [
    "ObjectStorageClient", "ObjectStorageClientCompositeOperations", "models",
    "MultipartObjectAssembler", "UploadManager"
]
Exemple #3
0
import requests
from six import string_types
import numpy as np
import xarray as xr
import traitlets as tl

from podpac.datalib import nasaCMR

# Set up logging
_log = logging.getLogger(__name__)

# Helper utility for optional imports
from lazy_import import lazy_module, lazy_class

h5py = lazy_module("h5py")
lazy_class("h5py.File")

# fixing problem with older versions of numpy
if not hasattr(np, "isnat"):

    def isnat(a):
        return a.astype(str) == "None"

    np.isnat = isnat

# Internal dependencies
from podpac import Coordinates, UnitsDataArray, cached_property
from podpac.datalib import EGI

SMAP_PRODUCT_DICT = {
    #'shortname':    ['lat_key', 'lon_key', '_data_key', 'quality_flag', 'default_verison']
Exemple #4
0
import os
import traitlets as tl
import numpy as np

from lazy_import import lazy_module, lazy_class, lazy_function

zarr = lazy_module("zarr")
zarr_open = lazy_function("zarr.convenience.open")
zarr_open_consolidated = lazy_function("zarr.convenience.open_consolidated")
zarrGroup = lazy_class("zarr.Group")

from podpac.core.authentication import S3Mixin
from podpac.core.utils import common_doc, cached_property
from podpac.core.data.datasource import COMMON_DATA_DOC, DATA_DOC
from podpac.core.data.file_source import BaseFileSource, FileKeysMixin
from podpac.core.interpolation.interpolation import InterpolationMixin


class ZarrRaw(S3Mixin, FileKeysMixin, BaseFileSource):
    """Create a DataSource node using zarr.

    Attributes
    ----------
    source : str
        Path to the Zarr archive
    file_mode : str, optional
        Default is 'r'. The mode used to open the Zarr archive. Options are r, r+, w, w- or x, a.
    dataset : zarr.Group
        The h5py file object used to read the file
    coordinates : :class:`podpac.Coordinates`
        {coordinates}
# coding: utf-8
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.

from __future__ import absolute_import

import lazy_import as _lazy_import

Bucket = _lazy_import.lazy_class("oci.object_storage.models.bucket.Bucket")
BucketSummary = _lazy_import.lazy_class(
    "oci.object_storage.models.bucket_summary.BucketSummary")
CommitMultipartUploadDetails = _lazy_import.lazy_class(
    "oci.object_storage.models.commit_multipart_upload_details.CommitMultipartUploadDetails"
)
CommitMultipartUploadPartDetails = _lazy_import.lazy_class(
    "oci.object_storage.models.commit_multipart_upload_part_details.CommitMultipartUploadPartDetails"
)
CopyObjectDetails = _lazy_import.lazy_class(
    "oci.object_storage.models.copy_object_details.CopyObjectDetails")
CreateBucketDetails = _lazy_import.lazy_class(
    "oci.object_storage.models.create_bucket_details.CreateBucketDetails")
CreateMultipartUploadDetails = _lazy_import.lazy_class(
    "oci.object_storage.models.create_multipart_upload_details.CreateMultipartUploadDetails"
)
CreatePreauthenticatedRequestDetails = _lazy_import.lazy_class(
    "oci.object_storage.models.create_preauthenticated_request_details.CreatePreauthenticatedRequestDetails"
)
ListObjects = _lazy_import.lazy_class(
    "oci.object_storage.models.list_objects.ListObjects")
MultipartUpload = _lazy_import.lazy_class(
    "oci.object_storage.models.multipart_upload.MultipartUpload")
MultipartUploadPartSummary = _lazy_import.lazy_class(
Exemple #6
0
            return getattr(module, unit_name)

        @staticmethod
        def lazy_class(c):
            return _lazy_import.lazy_function(c)


analysis = _lazy_import.lazy_module(".analysis")
app = _lazy_import.lazy_module(".app")
movers = _lazy_import.lazy_module(".movers")
mixers = _lazy_import.lazy_module(".mixers")
extractors = _lazy_import.lazy_module(".extractors")
iterators = _lazy_import.lazy_module(".iterators")
utils = _lazy_import.lazy_module(".utils")

Demographic = _lazy_import.lazy_class("._demographic.Demographic")
Demographics = _lazy_import.lazy_class("._demographics.Demographics")
Disease = _lazy_import.lazy_class("._disease.Disease")
Infections = _lazy_import.lazy_class("._infections.Infections")
InputFiles = _lazy_import.lazy_class("._inputfiles.InputFiles")
Interpret = _lazy_import.lazy_class("._interpret.Interpret")
Link = _lazy_import.lazy_class("._link.Link")
Links = _lazy_import.lazy_class("._links.Links")
Network = _lazy_import.lazy_class("._network.Network")
Networks = _lazy_import.lazy_class("._networks.Networks")
Node = _lazy_import.lazy_class("._node.Node")
Nodes = _lazy_import.lazy_class("._nodes.Nodes")
OutputFiles = _lazy_import.lazy_class("._outputfiles.OutputFiles")
Parameters = _lazy_import.lazy_class("._parameters.Parameters")
PersonType = _lazy_import.lazy_class("._network.PersonType")
Population = _lazy_import.lazy_class("._population.Population")
Exemple #7
0
from .dataset import BaseDataset, Literal, Iterable
import lazy_import
from datalib.util.logging import logger

os = lazy_import.lazy_module("os")
csv = lazy_import.lazy_module("csv")
ScannetScene = lazy_import.lazy_class(
    "datalib.scenes.scannetscene.ScannetScene")

HD_PATHS = ("{scene_id}.txt", "{scene_id}.sens", "{scene_id}_vh_clean.ply",
            "{scene_id}_vh_clean.segs.json", "{scene_id}.aggregation.json",
            "{scene_id}_2d-instance-filt.zip", "{scene_id}_2d-label-filt.zip",
            "{scene_id}_vh_clean_2.labels.ply")
# using other agg file but either should be fine
DEDIMATED_PATHS = ("{scene_id}.txt", "{scene_id}.sens",
                   "{scene_id}_vh_clean_2.ply",
                   "{scene_id}_vh_clean_2.0.010000.segs.json",
                   "{scene_id}_vh_clean.aggregation.json",
                   "{scene_id}_2d-instance-filt.zip",
                   "{scene_id}_2d-label-filt.zip",
                   "{scene_id}_vh_clean_2.labels.ply")


class ScannetDataset(BaseDataset):
    # Used to identify the dataset
    ID: Literal['Scannet']
    # Used to map all the files in the dataset. Contains 2 columns "SCENE_PATH" and "USE_HD"
    file_map: str

    @property
    def scenes(self) -> Iterable:
Exemple #8
0
import requests
from six import string_types
import numpy as np
import xarray as xr
import traitlets as tl

# Set up logging
_logger = logging.getLogger(__name__)

# Helper utility for optional imports
from lazy_import import lazy_module, lazy_class

# Optional dependencies
bs4 = lazy_module("bs4")
BeautifulSoup = lazy_class("bs4.BeautifulSoup")
boto3 = lazy_module("boto3")

# fixing problem with older versions of numpy
if not hasattr(np, "isnat"):

    def isnat(a):
        return a.astype(str) == "None"

    np.isnat = isnat

# Internal dependencies
import podpac
from podpac import NodeException
from podpac import authentication
from podpac.coordinates import Coordinates, merge_dims
Exemple #9
0
identity = _lazy_import.lazy_module("oci.identity")
key_management = _lazy_import.lazy_module("oci.key_management")
load_balancer = _lazy_import.lazy_module("oci.load_balancer")
object_storage = _lazy_import.lazy_module("oci.object_storage")
resource_search = _lazy_import.lazy_module("oci.resource_search")

auth = _lazy_import.lazy_module("oci.auth")
config = _lazy_import.lazy_module("oci.config")
constants = _lazy_import.lazy_module("oci.constants")
decorators = _lazy_import.lazy_module("oci.decorators")
exceptions = _lazy_import.lazy_module("oci.exceptions")
regions = _lazy_import.lazy_module("oci.regions")
pagination = _lazy_import.lazy_module("oci.pagination")
retry = _lazy_import.lazy_module("retry")

BaseClient = _lazy_import.lazy_class("oci.base_client.BaseClient")
Request = _lazy_import.lazy_class("oci.request.Request")
Signer = _lazy_import.lazy_class("oci.signer.Signer")

# from .version import __version__  # noqa

wait_until = _lazy_import.lazy_function("oci.waiter.wait_until")

__all__ = [
    "BaseClient", "Request", "Signer", "config", "constants", "decorators",
    "exceptions", "regions", "wait_until", "pagination", "auth", "retry",
    "audit", "container_engine", "core", "database", "dns", "email",
    "file_storage", "identity", "key_management", "load_balancer",
    "object_storage", "resource_search"
]