Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 24 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
language: generic
os:
- linux
- osx
- linux
env:
matrix:
- CONDA_ENV=3.7
- CONDA_ENV=3.6
- PYTHON="3.6"
- PYTHON="3.7"
- PYTHON="3.8"
global:
- CONDA_PREFIX=$HOME/miniconda
sudo: false
jobs:
include:
- stage: deploy
if: tag =~ v.*$
script: skip
os: linux
deploy:
on:
all_branches: true
provider: pypi
user: mcflugen
password:
secure: LG2bKxohg/kEOxLzFtAhCGMo8US9nIWBOXSGiCDR1zXA+JGv6QsrBy6xKKaNTF9Nb2fOkWJQQZfQNCz+V6P3f3MrqfLNRayfVjt+SmMhPIDfNeeMn1ZPDCcif+ugRqINyJk2c+dbwgqluRteqDMeoKW1PKrLzvpMWBn3V8+z9FQJ6PvlkyynoZAE1RCY/1YGjpo50xhPd5g0ucgeLbGnrvvxtZDvu/BmE/YJ3RAYFU5uK3BQLOBStWd35zi3gou4sf321c9cMLdwLVqs+fTeoElbsLADptGKYrVKwAeDgp22bGeBgpLaps/w0dcwpY2Cgnj/1fT3qx0kwU30Yu5V9BCSjdpvxjDYjm+4pKwXN+inbV68XqXcMxQ1s4B7RRkikdsJod03ruFylL+MvoVR7mfqTEd5d5TT83sgtKv7qX/1pUxk2Y+VtgItMqjhZz6PK0nB4APbLfgy+OmCwPdGaD2d0flL2t8T7XEKVGsu2sLgYOPaWzoPuBEsujDh3s6VeNtti8BiWflezEPj7SNCsqCfFZN6RnNHv6hoZEVQ79TsAdrjyPJTCZtXqLL9Yfflu5ZNojF8Mf8krp1QioASGgnNYTkB8Xsn6S9tV5vHf7lGNWbGlIxlWH5XLqkmBITY7UoGUOYaI7fhk9n7sxZ2tsVGKdH66fpqW9f/oSrdwp8=
before_install:
- |
if [[ $TRAVIS_OS_NAME == "osx" ]]; then
Expand All @@ -29,21 +19,28 @@ before_install:
fi
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
curl https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh > $HOME/miniconda.sh
OS="MacOSX-x86_64"
else
curl https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh > $HOME/miniconda.sh
OS="Linux-x86_64"
fi
- bash $HOME/miniconda.sh -b -p $HOME/anaconda
- export PATH="$HOME/anaconda/bin:$PATH"
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh > $HOME/miniconda.sh
else
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh > $HOME/miniconda.sh
fi
- bash $HOME/miniconda.sh -b -p $(pwd)/anaconda
- export PATH="$(pwd)/anaconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda create -n test_env python=$CONDA_ENV
- source activate test_env
- conda config --add channels conda-forge
- conda create -n _testing python=$PYTHON
- source activate _testing
- conda info -a && conda list
install:
- pip install bmi-tester model_metadata standard_names pytest
- pip install . -r requirements.txt
- pip install .
- conda install -q --file=requirements-library.txt
script:
- conda install -q --file=requirements-testing.txt
- python -c 'import pymt_rafem'
- |
config_file=$(mmd-stage pymt_rafem/data/Rafem . > MANIFEST && mmd-query pymt_rafem/data/Rafem --var=run.config_file.path)
bmi-test pymt_rafem.bmi:Rafem --config-file=$config_file --manifest=MANIFEST --root-dir=. -v
- bmi-test pymt_rafem.bmi:Rafem -vvv
19 changes: 19 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Changelog for pymt_rafem
========================

0.3 (unreleased)
----------------

- Nothing changed yet.


0.2 (2020-07-20)
----------------

- Added rand_seed to parameters

0.1.0 (2020-07-21)
------------------

- Initial release

4 changes: 4 additions & 0 deletions CREDITS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Credits
=======

* csdms <csdms@colorado.edu>
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018, Eric Hutton
Copyright (c) 2020, csdms

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
16 changes: 12 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
include versioneer.py
include _version.py
include pymt_rafem/_version.py
recursive-include pymt_rafem/data/ *
recursive-include pymt_rafem/data *
include LICENSE
include requirements.txt
include *.rst
include *.txt
include Makefile
include babel.toml
include pymt_rafem/data
recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs Makefile
recursive-exclude meta *
recursive-exclude recipe *
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ pretty:
black setup.py pymt_rafem

test: ## run tests quickly with the default Python
config_file=$(mmd-stage BmiRiverModule . > MANIFEST && mmd-query BmiRiverModule --var=run.config_file.path)
bmi-test pymt_rafem.bmi:BmiRiverModule --infile=$config_file --manifest=MANIFEST -v
bmi-test pymt_rafem.bmi:Rafem -vvv

test-all: ## run tests on every Python version with tox
tox
Expand Down Expand Up @@ -90,4 +89,4 @@ dist: clean ## builds source and wheel package
ls -l dist

install: clean ## install the package to the active Python's site-packages
python setup.py develop
pip install -e .
18 changes: 13 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ pymt_rafem


.. image:: https://img.shields.io/badge/CSDMS-Basic%20Model%20Interface-green.svg
:target: https://bmi-forum.readthedocs.io/
:target: https://bmi.readthedocs.io/
:alt: Basic Model Interface

.. image:: https://img.shields.io/badge/recipe-pymt_rafem-green.svg
:target: https://anaconda.org/conda-forge/pymt_rafem

.. image:: https://img.shields.io/travis/mcflugen/pymt_rafem.svg
:target: https://travis-ci.org/mcflugen/pymt_rafem
.. image:: https://img.shields.io/travis/pymt-lab/pymt_rafem.svg
:target: https://travis-ci.org/pymt-lab/pymt_rafem

.. image:: https://readthedocs.org/projects/pymt_rafem/badge/?version=latest
:target: https://pymt_rafem.readthedocs.io/en/latest/?badge=latest
Expand All @@ -25,10 +25,18 @@ pymt_rafem
PyMT plugin for Rafem


* Free software: MIT license
* Free software: MIT License
* Documentation: https://rafem.readthedocs.io.




========= ===================================
Component PyMT
========= ===================================
Rafem `from pymt.models import Rafem`
========= ===================================

---------------
Installing pymt
---------------
Expand All @@ -45,7 +53,7 @@ into which to install it. This can be done with,

.. code::

conda create -n pymt python=3.6
conda create -n pymt python=3
conda activate pymt

Once the `conda-forge` channel has been enabled, `pymt` can be installed with:
Expand Down
23 changes: 23 additions & 0 deletions babel.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[build]
define_macros = []
extra_compile_args = []
include_dirs = []
libraries = []
library_dirs = []
undef_macros = []

[info]
github_username = "pymt-lab"
plugin_author = "csdms"
plugin_author_email = "csdms@colorado.edu"
plugin_license = "MIT"
summary = "PyMT plugin for Rafem"

[library]
entry_point = ["Rafem=rafem:BmiRiverModule"]
language = "python"

[plugin]
name = "rafem"
requirements = ["rafem"]

6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@

# General information about the project.
project = u'pymt_rafem'
copyright = u"2018, Eric Hutton"
author = u"Eric Hutton"
copyright = u"2020, csdms"
author = u"csdms"

# The version info for the project you're documenting, acts as replacement
# for |version| and |release|, also used in various other places throughout
Expand Down Expand Up @@ -130,7 +130,7 @@
latex_documents = [
(master_doc, 'pymt_rafem.tex',
u'pymt_rafem Documentation',
u'Eric Hutton', 'manual'),
u'csdms', 'manual'),
]


Expand Down
8 changes: 4 additions & 4 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ You can either clone the public repository:

.. code-block:: console

$ git clone git://github.com/mcflugen/pymt_rafem
$ git clone git://github.com/pymt-lab/pymt_rafem

Or download the `tarball`_:

.. code-block:: console

$ curl -OL https://github.com/mcflugen/pymt_rafem/tarball/master
$ curl -OL https://github.com/pymt-lab/pymt_rafem/tarball/master

Once you have a copy of the source, you can install it with:

Expand All @@ -55,5 +55,5 @@ Once you have a copy of the source, you can install it with:
$ python setup.py install


.. _Github repo: https://github.com/mcflugen/pymt_rafem
.. _tarball: https://github.com/mcflugen/pymt_rafem/tarball/master
.. _Github repo: https://github.com/pymt-lab/pymt_rafem
.. _tarball: https://github.com/pymt-lab/pymt_rafem/tarball/master
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pymt_rafem/data/Rafem/input.yaml → meta/Rafem/input.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ max_rand: 0.1 # multiply by slope for max height of a random perturbation
dt_day: {{ time_step }} # timestep (days)

# Random seed
rand_seed: 1988 # seed for random number generator
rand_seed: {{ rand_seed }} # seed for random number generator

# Sea level and subsidence parameters
Initial_SL: {{ sea_level_initial }} # initial sea level
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ time_step:
max: 1.0
units: day

rand_seed:
description: Seed for random number generator
value:
type: int
default: 1988
range:
min: 1
max: 65536
units: '-'

sea_level_initial:
description: Initial sea level
value:
Expand Down
File renamed without changes.
21 changes: 0 additions & 21 deletions plugin.yaml

This file was deleted.

14 changes: 7 additions & 7 deletions pymt_rafem/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#! /usr/bin/env python
import pkg_resources

from .bmi import (Rafem,
)
__version__ = pkg_resources.get_distribution("pymt_rafem").version

__all__ = ["Rafem",
]

from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
from .bmi import Rafem

__all__ = [
"Rafem",
]
10 changes: 5 additions & 5 deletions pymt_rafem/bmi.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from __future__ import absolute_import

import os

import pkg_resources
from rafem import BmiRiverModule as Rafem

Rafem.__name__ = "Rafem"
Rafem.METADATA = os.path.abspath(
pkg_resources.resource_filename("pymt_rafem", "data/Rafem")
)
Rafem.METADATA = pkg_resources.resource_filename(__name__, "data/Rafem")

__all__ = [
"Rafem",
]
1 change: 1 addition & 0 deletions pymt_rafem/data
7 changes: 0 additions & 7 deletions pymt_rafem/rafem.py

This file was deleted.

33 changes: 33 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[build-system]
requires = ["cython", "numpy", "setuptools", "wheel"]

[tool.pytest.ini_options]
minversion = "5.0"
testpaths = ["pymt_rafem", "tests"]
norecursedirs = [".*", "*.egg*", "build", "dist"]
addopts = """
--ignore setup.py
--tb native
--strict
--durations 16
--doctest-modules
-vvv
"""
doctest_optionflags = [
"NORMALIZE_WHITESPACE",
"IGNORE_EXCEPTION_DETAIL",
"ALLOW_UNICODE"
]

[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
combine_as_imports = true
line_length = 88

[tool.check-manifest]
ignore = [
"pymt_rafem/data",
"pymt_rafem/data/**/*",
]
Loading