Skip to content

Commit b2edd18

Browse files
author
Paul Branson
committed
First prototype, mostly functional code
1 parent 1c71981 commit b2edd18

38 files changed

+8770
-3
lines changed

.ci-coveragerc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[run]
2+
omit = *tests/*, */_version.py

.coveragerc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[run]
2+
omit =
3+
*/tests/*
4+
*/test_*.py
5+
*_version.py
6+
source =
7+
rompy
8+
[report]
9+
show_missing = True

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rompy/_version.py export-subst

.github/workflows/main.yaml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: "*"
6+
pull_request:
7+
branches: master
8+
9+
jobs:
10+
test:
11+
name: ${{ matrix.CONDA_ENV }}-pytest
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
CONDA_ENV: [py37, py38, pip]
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
21+
- name: Setup Miniconda
22+
uses: conda-incubator/setup-miniconda@v2
23+
with:
24+
auto-update-conda: true
25+
auto-activate-base: false
26+
activate-environment: test_env
27+
environment-file: scripts/ci/environment-${{ matrix.CONDA_ENV }}.yml
28+
29+
- name: pip-install
30+
shell: bash -l {0}
31+
run: |
32+
pip install -e . --no-deps
33+
34+
- name: Run Tests
35+
shell: bash -l {0}
36+
run: |
37+
pytest --verbose --cov=rompy

.github/workflows/pypipublish.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: "3.x"
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install setuptools setuptools-scm wheel twine
20+
- name: Build and publish
21+
env:
22+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
23+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
24+
run: |
25+
python setup.py sdist bdist_wheel
26+
twine upload dist/*

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,11 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
### vscode ###
132+
.vscode/*
133+
!.vscode/settings.json
134+
!.vscode/tasks.json
135+
!.vscode/launch.json
136+
!.vscode/extensions.json
137+
*.code-workspace

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2021, rom-py
3+
Copyright (c) 2021, rompy
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

MANIFEST.in

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
recursive-include rompy *.html
2+
recursive-include rompy *.csv
3+
recursive-include rompy *.npy
4+
recursive-include rompy *.yml
5+
recursive-include rompy *.yaml
6+
recursive-include rompy *.zip
7+
recursive-include rompy *.png
8+
recursive-include docs/source *
9+
include docs/Makefile docs/make.bat
10+
11+
recursive-include templates *
12+
13+
include versioneer.py
14+
include rompy/_version.py
15+
include requirements.txt
16+
include LICENSE

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# rom-py
2-
Relocatable Ocean Modelling in PYthon (rom-py) combines templated cookie-cutter model configuration with various xarray extensions to assist in the setup and evaluation of coastal ocean model
1+
# rompy
2+
Relocatable Ocean Modelling in PYthon (rompy) combines templated cookie-cutter model configuration with various xarray extensions to assist in the setup and evaluation of coastal ocean model

appveyor.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Based on bokeh appveyor set up
2+
build: false
3+
4+
platform:
5+
- x64
6+
7+
environment:
8+
matrix:
9+
- MINICONDA: C:\Miniconda36-x64
10+
11+
skip_branch_with_pr: true
12+
clone_depth: 5
13+
skip_tags: true
14+
15+
init:
16+
- cmd: set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%MINICONDA%\\Library\\bin;%PATH%
17+
- cmd: echo %path%
18+
19+
install:
20+
- powershell .\\scripts\\ci\\appveyor\\install.ps1
21+
22+
build_script:
23+
- powershell .\\scripts\\ci\\appveyor\\build.ps1
24+
25+
test_script:
26+
- py.test

docs/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/source/api.rst

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Base Classes
2+
------------
3+
4+
This is a reference API class listing, useful mainly for developers.
5+
6+
7+
.. autosummary::
8+
rompy.core.BaseModel
9+
rompy.core.BaseGrid
10+
rompy.swan.SwanModel
11+
rompy.swan.SwanGrid
12+
rompy.intake.NetCDFFCStackSource
13+
14+
.. autoclass:: rompy.core.BaseModel
15+
:members:
16+
17+
.. autoclass:: rompy.core.BaseGrid
18+
:members:
19+
20+
.. autoclass:: rompy.swan.SwanModel
21+
:members:
22+
23+
.. autoclass:: rompy.swan.SwanGrid
24+
:members:
25+
26+
.. autoclass:: rompy.intake.NetCDFFCStackSource
27+
:members:

docs/source/conf.py

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'rompy'
21+
copyright = '2021, Paul Branson'
22+
author = 'Paul Branson'
23+
24+
25+
# -- General configuration ---------------------------------------------------
26+
27+
# Add any Sphinx extension module names here, as strings. They can be
28+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
29+
# ones.
30+
extensions = ['sphinx.ext.autodoc'
31+
]
32+
33+
# Add any paths that contain templates here, relative to this directory.
34+
templates_path = ['_templates']
35+
36+
# List of patterns, relative to source directory, that match files and
37+
# directories to ignore when looking for source files.
38+
# This pattern also affects html_static_path and html_extra_path.
39+
exclude_patterns = []
40+
41+
42+
# -- Options for HTML output -------------------------------------------------
43+
44+
# The theme to use for HTML and HTML Help pages. See the documentation for
45+
# a list of builtin themes.
46+
#
47+
html_theme = 'alabaster'
48+
49+
# Add any paths that contain custom static files (such as style sheets) here,
50+
# relative to this directory. They are copied after the builtin static files,
51+
# so a file named "default.css" will overwrite the builtin "default.css".
52+
html_static_path = ['_static']

docs/source/index.rst

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. rompy documentation master file, created by
2+
sphinx-quickstart on Tue Feb 9 21:11:02 2021.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to rompy's documentation!
7+
=================================
8+
9+
*Taking the pain out of ocean model setup*
10+
11+
.. toctree::
12+
:maxdepth: 1
13+
:caption: Contents:
14+
15+
api.rst
16+
17+
Indices and tables
18+
==================
19+
20+
* :ref:`genindex`
21+
* :ref:`modindex`
22+
* :ref:`search`

0 commit comments

Comments
 (0)