Skip to content

Commit

Permalink
update project, no longer masked array for gpi, lon, lat
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhahn committed Jul 13, 2024
1 parent f18910b commit 57b2f30
Show file tree
Hide file tree
Showing 19 changed files with 160 additions and 147 deletions.
48 changes: 27 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,44 @@
name: tests
name: Automated Tests

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *' # daily
- cron: "0 0 * * *" # daily

jobs:
build:
name: Build py${{ matrix.python-version }} @ ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest"] # currently windows is not tested
python-version: ['3.6', '3.7', '3.8']
ymlfile: ['environment.yml']
name: Py${{ matrix.python-version }}@${{ matrix.os }}|${{ matrix.ymlfile }}
runs-on: ${{ matrix.os }}
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: ["ubuntu-latest", "windows-latest"]
ymlfile: ["environment.yml"]

steps:
- uses: actions/checkout@v2
with:
submodules: false
submodules: false # does not work with self-hosted testdata
- name: Checkout test data
shell: bash -l {0}
run : |
git submodule init
git submodule sync
git submodule update
- uses: conda-incubator/setup-miniconda@v2.0.1
with:
miniconda-version: "latest"
auto-update-conda: true
miniforge-variant: Mambaforge
miniforge-version: "latest"
channel-priority: flexible
python-version: ${{ matrix.python-version }}
environment-file: ${{ matrix.ymlfile }}
activate-environment: fibgrid_env
activate-environment: env
auto-activate-base: false
- name: Print Infos
- name: Print infos
shell: bash -l {0}
run: |
git status
conda info -a
conda list
pip list
Expand All @@ -39,15 +48,12 @@ jobs:
shell: bash -l {0}
run: |
mkdir -p .artifacts
if [ ${{ matrix.ymlfile }} == "environment.yml" ]
then
filename=env_py${{ matrix.python-version }}_${{ matrix.os }}.yml
conda env export --no-builds | grep -v "prefix" > .artifacts/$filename
fi
filename=env_py${{ matrix.python-version }}_${{ matrix.os }}.yml
conda env export --no-builds | grep -v "prefix" > .artifacts/$filename
- name: Install package and test
shell: bash -l {0}
run: |
pip install .
pip install -e .[testing]
pytest --cache-clear
- name: Upload Coverage
shell: bash -l {0}
Expand All @@ -57,12 +63,12 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
COVERALLS_PARALLEL: true
- name: Create wheel package
- name: Create wheel and dist package
shell: bash -l {0}
run: |
pip install wheel
git status
pip install setuptools_scm
python setup.py sdist --dist-dir .artifacts/dist
python setup.py bdist_wheel --dist-dir .artifacts/dist
ls .artifacts/dist
- name: Upload Artifacts
uses: actions/upload-artifact@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ MANIFEST
# Per-project virtualenvs
.venv*/
.conda*/
.python-version
7 changes: 6 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ sphinx:
formats:
- pdf

build:
os: ubuntu-22.04
tools:
python: "3.11"

python:
version: 3.8
install:
- requirements: docs/requirements.txt
- {path: ., method: pip}
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog
=========

Version 0.0.5
=============

- GPI, longitude, latitude of grid object no longer masked array

Version 0.0.4
=============

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021 TU Wien, Department of Geodesy and Geoinformation
Copyright (c) 2024 TU Wien

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ Creating Fibonacci grid and read pre-computed grids.
Note
====

This project has been set up using PyScaffold 4.0.1. For details and usage
This project has been set up using PyScaffold 4.5. For details and usage
information on PyScaffold see https://pyscaffold.org/.
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ AUTODOCDIR = api

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $?), 1)
$(error "The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/")
$(error "The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from https://sphinx-doc.org/")
endif

.PHONY: help clean Makefile
Expand Down
59 changes: 35 additions & 24 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@

import os
import sys
import inspect
import shutil

# -- Path setup --------------------------------------------------------------

__location__ = os.path.join(
os.getcwd(), os.path.dirname(inspect.getfile(inspect.currentframe()))
)
__location__ = os.path.dirname(__file__)

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand All @@ -26,7 +23,7 @@
# -- Run sphinx-apidoc -------------------------------------------------------
# This hack is necessary since RTD does not issue `sphinx-apidoc` before running
# `sphinx-build -b html . _build/html`. See Issue:
# https://github.com/rtfd/readthedocs.org/issues/1139
# https://github.com/readthedocs/readthedocs.org/issues/1139
# DON'T FORGET: Check the box "Install your project inside a virtualenv using
# setup.py install" in the RTD Advanced Settings.
# Additionally it helps us to avoid running apidoc manually
Expand All @@ -46,11 +43,7 @@
try:
import sphinx

cmd_line_template = (
"sphinx-apidoc --implicit-namespaces -f -o {outputdir} {moduledir}"
)
cmd_line = cmd_line_template.format(
outputdir=output_dir, moduledir=module_dir)
cmd_line = f"sphinx-apidoc --implicit-namespaces -f -o {output_dir} {module_dir}"

args = cmd_line.split(" ")
if tuple(sphinx.__version__.split(".")) >= ("1", "7"):
Expand Down Expand Up @@ -79,13 +72,18 @@
"sphinx.ext.ifconfig",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"myst_nb",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# The suffix of source filenames.
source_suffix = ".rst"
source_suffix = {
".rst": "restructuredtext",
".ipynb": "myst-nb",
".myst": "myst-nb",
}

# The encoding of source files.
# source_encoding = 'utf-8-sig'
Expand All @@ -95,16 +93,25 @@

# General information about the project.
project = "fibgrid"
copyright = "2021, TU Wien"
copyright = "2024, TU Wien"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = "" # Is set by calling `setup.py docs`
# The full version, including alpha/beta/rc tags.
release = "" # Is set by calling `setup.py docs`
# version: The short X.Y version.
# release: The full version, including alpha/beta/rc tags.
# If you don’t need the separation provided between version and release,
# just set them both to the same value.
try:
from fibgrid import __version__ as version
except ImportError:
version = ""

if not version or version.lower() == "unknown":
version = os.getenv("READTHEDOCS_VERSION", "unknown") # automatically set by RTD

release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -143,6 +150,9 @@
# If true, keep warnings as "system message" paragraphs in the built documents.
# keep_warnings = False

# If this is True, todo emits a warning for each TODO entries. The default is False.
todo_emit_warnings = True


# -- Options for HTML output -------------------------------------------------

Expand All @@ -163,12 +173,7 @@

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
try:
from fibgrid import __version__ as version
except ImportError:
pass
else:
release = version
# html_title = None

# A shorter title for the navigation bar. Default is the same as html_title.
# html_short_title = None
Expand Down Expand Up @@ -272,12 +277,18 @@
# -- External mapping --------------------------------------------------------
python_version = ".".join(map(str, sys.version_info[0:2]))
intersphinx_mapping = {
"sphinx": ("http://www.sphinx-doc.org/en/stable", None),
"sphinx": ("https://www.sphinx-doc.org/en/master", None),
"python": ("https://docs.python.org/" + python_version, None),
"matplotlib": ("https://matplotlib.org", None),
"numpy": ("https://docs.scipy.org/doc/numpy", None),
"numpy": ("https://numpy.org/doc/stable", None),
"sklearn": ("https://scikit-learn.org/stable", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
"setuptools": ("https://setuptools.pypa.io/en/stable/", None),
"pyscaffold": ("https://pyscaffold.org/en/stable", None),
}

print(f"loading configurations for {project} {version} ...", file=sys.stderr)

# -- MyST-NB config ----------------------------------------------------------
nb_execution_mode = 'off'
26 changes: 13 additions & 13 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ Indices and tables
* :ref:`modindex`
* :ref:`search`

.. _toctree: http://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html
.. _reStructuredText: http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
.. _references: http://www.sphinx-doc.org/en/stable/markup/inline.html
.. _Python domain syntax: http://sphinx-doc.org/domains.html#the-python-domain
.. _Sphinx: http://www.sphinx-doc.org/
.. _Python: http://docs.python.org/
.. _Numpy: http://docs.scipy.org/doc/numpy
.. _SciPy: http://docs.scipy.org/doc/scipy/reference/
.. _toctree: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html
.. _reStructuredText: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
.. _references: https://www.sphinx-doc.org/en/stable/markup/inline.html
.. _Python domain syntax: https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#the-python-domain
.. _Sphinx: https://www.sphinx-doc.org/
.. _Python: https://docs.python.org/
.. _Numpy: https://numpy.org/doc/stable
.. _SciPy: https://docs.scipy.org/doc/scipy/reference/
.. _matplotlib: https://matplotlib.org/contents.html#
.. _Pandas: http://pandas.pydata.org/pandas-docs/stable
.. _Scikit-Learn: http://scikit-learn.org/stable
.. _autodoc: http://www.sphinx-doc.org/en/stable/ext/autodoc.html
.. _Google style: https://github.com/google/styleguide/blob/gh-pages/pyguide.md#38-comments-and-docstrings
.. _Pandas: https://pandas.pydata.org/pandas-docs/stable
.. _Scikit-Learn: https://scikit-learn.org/stable
.. _autodoc: https://www.sphinx-doc.org/en/master/ext/autodoc.html
.. _Google style: https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings
.. _NumPy style: https://numpydoc.readthedocs.io/en/latest/format.html
.. _classical style: http://www.sphinx-doc.org/en/stable/domains.html#info-field-lists
.. _classical style: https://www.sphinx-doc.org/en/master/domains.html#info-field-lists
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
# To build the module reference correctly, make sure every external package
# under `install_requires` in `setup.cfg` is also listed here!
sphinx>=3.2.1
myst-nb
# sphinx_rtd_theme
9 changes: 1 addition & 8 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
name: fibgrid_env
channels:
- defaults
- conda-forge
name: env
dependencies:
- numpy
- netCDF4
Expand All @@ -10,7 +7,3 @@ dependencies:
- pip
- pip:
- pygeogrids
- pytest
- pytest-cov
- pytest-mpl
- flake8
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[build-system]
# AVOID CHANGING REQUIRES: IT WILL BE UPDATED BY PYSCAFFOLD!
requires = ["setuptools>=46.1.0", "setuptools_scm[toml]>=5", "wheel"]
requires = ["setuptools>=46.1.0", "setuptools_scm[toml]>=5"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
# See configuration details in https://github.com/pypa/setuptools_scm
# For smarter version schemes and other configuration options,
# check out https://github.com/pypa/setuptools_scm
version_scheme = "no-guess-dev"
Loading

0 comments on commit 57b2f30

Please sign in to comment.