TNO Intern

Commit 7de20659 authored by Arjo Segers's avatar Arjo Segers
Browse files

Merge branch 'pages' into 'master'

Pages

See merge request !12
parents 27ef389b bec3daae
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
# The Docker image that will be used to build your app
image: python:3.11
image: python:latest-slim

# Functions that should be executed before the build script is run
before_script:
@@ -18,7 +18,7 @@ pages:
      when: always
  script:
    - cd doc
    - make html
    - sphinx-build source build/html
    - cd ..
    - mkdir public
    - cp -r doc/build/html/* public
+2 −2
Original line number Diff line number Diff line
@@ -283,7 +283,7 @@ This should now be done when code is changed using a '*pipeline*'.
   .. sourcecode:: yaml

      # The Docker image that will be used to build your app
      image: python:3.11
      image: python:latest-slim

      # Functions that should be executed before the build script is run
      before_script:
@@ -300,7 +300,7 @@ This should now be done when code is changed using a '*pipeline*'.
            when: always
        script:
          - cd doc
          - make html
          - sphinx-build source build/html
          - cd ..
          - mkdir public
          - cp -r doc/build/html/* public
+7 −4
Original line number Diff line number Diff line
@@ -120,11 +120,14 @@ and are defined according to the following hierchy:
# store version number:
try:
    from importlib import metadata

    __version__ = metadata.version(__package__)
except:
    import os

    if "CSO_PREFIX" in os.environ.keys():
        import tomllib

        with open(os.path.join(os.environ["CSO_PREFIX"], "pyproject.toml"), "rb") as f:
            pp = tomllib.load(f)
        __version__ = pp["project"]["version"]
+15 −16
Original line number Diff line number Diff line
@@ -799,7 +799,6 @@ class CSO_EarthAccess_Download_Listing(utopya.UtopyaRc):
            for root, dirs, files in os.walk(bdir):
                # loop over files:
                for fname in files:

                    # subdir relative to listing file:
                    subdir = os.path.relpath(root, start=bdir)
                    # info ...
@@ -818,12 +817,10 @@ class CSO_EarthAccess_Download_Listing(utopya.UtopyaRc):

                    # data file?
                    if fnmatch.fnmatch(fname, fpattern):

                        # expected filenames:
                        #   AERDB_L2_VIIRS_SNPP.A2022001.0342.002.2023076013614.nc
                        parts = fname.split(".")
                        if len(parts) == 6:

                            # second is year-julday, strip the "A" of acquisition:
                            try:
                                t1 = datetime.datetime.strptime(parts[1][1:], "%Y%j")
@@ -854,7 +851,9 @@ class CSO_EarthAccess_Download_Listing(utopya.UtopyaRc):
                        data["orbit"] = orbit

                        # update record:
                        listing.UpdateRecord( os.path.join(subdir,fname), data, indent=f"{indent}    ")
                        listing.UpdateRecord(
                            os.path.join(subdir, fname), data, indent=f"{indent}    "
                        )

                    # endfor # filename match

+17 −15
Original line number Diff line number Diff line
@@ -636,7 +636,9 @@ class CSO_File(object):
            for vname in self.ds.keys():
                # only numerical values:
                dtype = self.ds[vname].dtype
                if numpy.issubdtype(dtype,numpy.integer) or numpy.issubdtype(dtype,numpy.floating):
                if numpy.issubdtype(dtype, numpy.integer) or numpy.issubdtype(
                    dtype, numpy.floating
                ):
                    # enable zlib compression and set level:
                    self.ds[vname].encoding["zlib"] = True
                    self.ds[vname].encoding["complevel"] = complevel
@@ -1313,7 +1315,6 @@ class CSO_Listing(object):

        # directory name:
        if self.filename is not None:

            # check ..
            if not os.path.isfile(filename):
                logging.error("listing file not found: %s" % filename)
@@ -1342,7 +1343,6 @@ class CSO_Listing(object):
            self.df["end_time"] = pandas.to_datetime(self.df["end_time"])

        else:

            # not defined yet, assume current location:
            self.dirname = os.curdir

@@ -1564,7 +1564,9 @@ class CSO_Listing(object):

    # *

    def Select(self, tr=None, method="overlap", expr=None, blacklist=[], verbose=True, indent="", **kwargs):
    def Select(
        self, tr=None, method="overlap", expr=None, blacklist=[], verbose=True, indent="", **kwargs
    ):
        """
        Return :py:class:`CSO_Listing` object with selection of records.

Loading