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