diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e36c8f13ea4884760fb80f4e9e6f868278dfd385..404ebee9dc722e1d2d72b169b419bd12aba093ab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,14 +1,24 @@ image: python:latest +variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" + before_script: - curl -sSL https://install.python-poetry.org | python3 - - export PATH="/root/.local/bin:$PATH" - poetry --version + - poetry config virtualenvs.in-project true + +cache: + paths: + - .cache/pip + - .venv stages: - build_package - testing - create_docs + - deploy build_package: stage: build_package @@ -34,6 +44,17 @@ create_docs: - poetry install - cd docs - poetry run sphinx-build -b html . ../public + artifacts: + paths: + - public + +deploy_docs: + stage: deploy + needs: [create_docs] + variables: + docs_upload_host: hosted-024-173.rz.uni-augsburg.de + docs_path_component: icartt + script: # Following lines are ssh-agent setup and key injection, to allow upload of docs - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )' - 'command -v rsync >/dev/null || ( apt-get update -y && apt-get install --no-install-recommends rsync -y )' @@ -43,7 +64,7 @@ create_docs: - echo "$docs_ssh_key" | tr -d ' ' | base64 --decode | ssh-add - - mkdir -p ~/.ssh && chmod 700 ~/.ssh - ssh-keyscan ${docs_upload_host} > ~/.ssh/known_hosts - - rsync -ax ../public/ ${CI_PROJECT_NAME}-docs@${docs_upload_host}:/srv/docs/${docs_path_component}/public/$(poetry version -s)/ - artifacts: - paths: - - public + - rsync -ax public/ ${CI_PROJECT_NAME}-docs@${docs_upload_host}:/srv/docs/${docs_path_component}/public/$(poetry version -s)/ + rules: + # only deploy docs if the SSH key masked variable is set. + - if: $docs_ssh_key diff --git a/README.md b/README.md index 0418ea02142f68c12b82c1c871800c417bd4bf5e..4172b6eccfde64c1ef8620857842b0b7eb74e8f4 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ poetry shell # Changelog -## 2.0.0 (2022-04-x) +## 2.0.0 (2022-04-28) - Compatible with ICARTT v2 standard - Formats 1001 and 2110 diff --git a/docs/conf.py b/docs/conf.py index c92353667345ec085984d4513ea8f7c378cf5459..49331ae28d91cd39c43e3e0c1d81189e118f6d32 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,11 +18,11 @@ # -- Project information ----------------------------------------------------- project = "ICARTT" -copyright = "2022, Christoph Knote" +copyright = "2022, Christoph Knote, Model-based Environmental Exposure Science, University Augsburg, Augsburg, Germany" author = "Christoph Knote" # The full version, including alpha/beta/rc tags -release = "2.0" +release = "2.0.0" # -- General configuration --------------------------------------------------- diff --git a/pyproject.toml b/pyproject.toml index 345808fa201968db6b19e01220891edc4c3f4ac8..71144d4753dce1dcd8c8a5aa7a53eac85a87168f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,23 +1,21 @@ [tool.poetry] name = "icartt" -version = "2.0.0-rc1" +version = "2.0.0" description = "ICARTT format reader and writer" license = "GPL-3.0-or-later" authors = ["Christoph Knote ", "Florian Obersteiner "] readme = "README.md" homepage = "https://mbees.med.uni-augsburg.de/" repository = "https://mbees.med.uni-augsburg.de/gitlab/mbees/icartt_pypackage" -documentation = "https://mbees.med.uni-augsburg.de/docs/icartt/" +documentation = "https://mbees.med.uni-augsburg.de/docs/icartt/2.0.0/" keywords = [ "atmosphere", "file format", "ames", "nasa" ] classifiers = [ - "Programming Language :: Python :: 3", "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: End Users/Desktop", "Intended Audience :: Science/Research", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: POSIX", "Topic :: Education", "Topic :: Scientific/Engineering", @@ -33,8 +31,8 @@ packages = [ [tool.poetry.dependencies] -python = ">=3.8,<4.0" -numpy = ">= 1.12" +python = ">= 3.7, < 4" +numpy = ">= 1.19" [tool.poetry.dev-dependencies] @@ -42,7 +40,7 @@ pytest = "^5.2" coverage = ">= 6.3.2" sphinx = ">= 4.4" sphinx-rtd-theme = ">= 1.0" -enum-tools = ">= 0.9" +enum-tools = ">=0.9" sphinx-toolbox = ">= 2.16.0" black = "^22.3.0" diff --git a/src/icartt/dataset.py b/src/icartt/dataset.py index d49ceaf7d7379a577edba30d88f905b60ab44714..e4a685b40448815a114f984c735bdad31768acd4 100644 --- a/src/icartt/dataset.py +++ b/src/icartt/dataset.py @@ -8,7 +8,7 @@ from enum import IntEnum import numpy as np -from . import ictutils as utl +from . import utils DEFAULT_NUM_FORMAT = "%g" """Default number format for output. Provides the `fmt` parameter of :func:`numpy.savetxt` internally.""" @@ -504,7 +504,7 @@ class Dataset: if self.inputFhandle: if self.inputFhandle.closed: self.inputFhandle = open(self.inputFhandle.name, encoding="utf-8") - f = utl.FilehandleWithLinecounter(self.inputFhandle, delimiter) + f = utils.FilehandleWithLinecounter(self.inputFhandle, delimiter) self._readHeader(f) self.inputFhandle.close() @@ -569,7 +569,7 @@ class Dataset: if self.format == Formats.FFI2110: dmp = f.readline() - shortname, units, standardname, longname = utl.extractVardesc(dmp) + shortname, units, standardname, longname = utils.extractVardesc(dmp) self.independentBoundedVariable = Variable( shortname, units, @@ -579,7 +579,7 @@ class Dataset: ) dmp = f.readline() - shortname, units, standardname, longname = utl.extractVardesc(dmp) + shortname, units, standardname, longname = utils.extractVardesc(dmp) self.independentVariable = Variable( shortname, units, @@ -612,7 +612,7 @@ class Dataset: # the name used for that variable as a column header, i.e., the last header # line prior to start of data.). dmp = f.readline() - shortname, units, standardname, longname = utl.extractVardesc(dmp) + shortname, units, standardname, longname = utils.extractVardesc(dmp) vshortname = [shortname] vunits = [units] vstandardname = [standardname] @@ -620,7 +620,7 @@ class Dataset: for _ in range(1, nvar): dmp = f.readline() - shortname, units, standardname, longname = utl.extractVardesc(dmp) + shortname, units, standardname, longname = utils.extractVardesc(dmp) vshortname += [shortname] vunits += [units] vstandardname += [standardname] diff --git a/src/icartt/ictutils.py b/src/icartt/utils.py similarity index 100% rename from src/icartt/ictutils.py rename to src/icartt/utils.py