Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: passaH2O/dorado
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.5.1
Choose a base ref
...
head repository: passaH2O/dorado
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 17 commits
  • 10 files changed
  • 3 contributors

Commits on May 2, 2022

  1. remove F*

    elbeejay committed May 2, 2022
    Copy the full SHA
    37370dd View commit details

Commits on Jun 7, 2022

  1. Merge pull request #36 from elbeejay/revise-background-docs

    remove F* from docs
    elbeejay authored Jun 7, 2022
    Copy the full SHA
    637ac0b View commit details

Commits on Jun 20, 2022

  1. schedule monthly CI build

    Update build.yml to schedule monthly continuous integration runs
    elbeejay authored Jun 20, 2022
    Copy the full SHA
    4feefd6 View commit details

Commits on Sep 3, 2022

  1. Update build.yml

    drop python 3.6 from CI
    elbeejay authored Sep 3, 2022
    Copy the full SHA
    f789a48 View commit details
  2. Update setup.py

    drop python 3.6
    elbeejay authored Sep 3, 2022
    Copy the full SHA
    487c239 View commit details

Commits on Dec 6, 2022

  1. clean-up for conda-forge (#38)

    * Update __init__.py
    
    * Update build.yml
    
    * Update __init__.py
    
    * Update setup.py
    
    * Update particle_track.py
    
    typo fix
    elbeejay authored Dec 6, 2022
    Copy the full SHA
    cd1b4f4 View commit details
  2. increment minor version

    elbeejay committed Dec 6, 2022
    Copy the full SHA
    3d2fe59 View commit details

Commits on Dec 8, 2022

  1. Conda install (#39)

    * update install docs
    
    add mamba to install docs
    
    * conda install in readme
    elbeejay authored Dec 8, 2022
    Copy the full SHA
    e485471 View commit details

Commits on Jun 17, 2023

  1. Copy the full SHA
    a875086 View commit details

Commits on Jun 20, 2023

  1. Merge pull request #43 from elbeejay/doc-mathjax

    switch to mathjax for docs math
    wrightky authored Jun 20, 2023
    Copy the full SHA
    90d0307 View commit details
  2. Copy the full SHA
    08dda92 View commit details
  3. Copy the full SHA
    b93edee View commit details
  4. Copy the full SHA
    0079962 View commit details
  5. Copy the full SHA
    f543ed5 View commit details
  6. increment version

    wrightky committed Jun 20, 2023
    Copy the full SHA
    2fe1a4c View commit details
  7. Merge pull request #44 from wrightky/master

    Fix and update build actions
    wrightky authored Jun 20, 2023
    Copy the full SHA
    657d390 View commit details
  8. Add missing comma (typo)

    wrightky authored Jun 20, 2023
    Copy the full SHA
    8c90ac9 View commit details
Showing with 43 additions and 49 deletions.
  1. +8 −32 .github/workflows/build.yml
  2. +4 −0 README.md
  3. +3 −0 conda/conda_build_config.yaml
  4. +2 −2 docs/source/background/index.rst
  5. +1 −1 docs/source/conf.py
  6. +8 −0 docs/source/install/index.rst
  7. +1 −2 dorado/__init__.py
  8. +1 −1 dorado/particle_track.py
  9. +8 −7 setup.py
  10. +7 −4 tests/test_examplecases.py
40 changes: 8 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -2,7 +2,11 @@

name: build

on: [push, pull_request]
on:
push:
pull_request:
schedule:
- cron: '0 0 3 * *' # run workflow at 12AM on third day of every month

jobs:
build:
@@ -11,7 +15,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
@@ -39,43 +43,15 @@ jobs:
file: ./coverage.xml
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: true

legacy:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [2.7]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov coveralls
pip install -r requirements.txt
- name: Install dorado
run: |
pip install -e .
- name: Test with pytest
run: |
pytest --cov=dorado/ --cov-report=xml
fail_ci_if_error: false

examples:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.7]
python-version: ["3.9"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -30,6 +30,10 @@ dorado supports Python 2.7 as well as Python 3.5+. For the full distribution inc
For a lightweight distribution including just the core functionality, use `pip` to install via PyPI:

pip install pydorado

Installation using `conda` via `conda-forge` is also supported:

conda install -c conda-forge pydorado

For additional installation options and instructions, refer to the [documentation](https://passah2o.github.io/dorado/install/index.html).

3 changes: 3 additions & 0 deletions conda/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -3,3 +3,6 @@ python:
- 3.6
- 3.7
- 3.8
- 3.9
- 3.10
- 3.11
4 changes: 2 additions & 2 deletions docs/source/background/index.rst
Original file line number Diff line number Diff line change
@@ -22,11 +22,11 @@ Particle transport is simulated through the use of a weighted random walk framew

The weights for the random walk are sensitive to 2 parameters, :math:`{\gamma}` and :math:`{\theta}`.

The routing direction (F*) is the estimate of the local downstream of the flow [5]_. This direction F* is comprised of :math:`{F_{sfc}}`, and :math:`{F_{int}}`, calculated based on the water surface gradient and the discharge respectively. The proportional combination of these directional components is dictated by the parameter :math:`{\gamma}`:
The routing direction (F) is the estimate of the local downstream of the flow [5]_. This direction F is comprised of :math:`{F_{sfc}}`, and :math:`{F_{int}}`, calculated based on the water surface gradient and the discharge respectively. The proportional combination of these directional components is dictated by the parameter :math:`{\gamma}`:

.. math::
F^{*} = \gamma F_{sfc} + (1-\gamma) F_{int}
F = \gamma F_{sfc} + (1-\gamma) F_{int}
In this way, the :math:`{\gamma}` parameter controls the proportional dependence of water surface slope and water discharge on the downstream direction. A :math:`{\gamma}` of 0 means that the water slope is ignored when determining the downstream flow direction, and a :math:`{\gamma}` of 1 means that the discharge values (the flow field) is ignored.

2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
'sphinx.ext.graphviz',
'sphinx.ext.imgmath',
'sphinx.ext.mathjax',
'sphinx.ext.githubpages',
'matplotlib.sphinxext.plot_directive',
'sphinx.ext.viewcode',
8 changes: 8 additions & 0 deletions docs/source/install/index.rst
Original file line number Diff line number Diff line change
@@ -13,6 +13,14 @@ To `pip`-install this package, first ensure that you have the dependencies liste
::

$ pip install pydorado
Installation via `conda`
------------------------

This package is available via `conda-forge <https://anaconda.org/conda-forge>`_ and can be installed using `conda` (or `mamba`) using the command:
::

$ conda install -c conda-forge pydorado


Installation from source
3 changes: 1 addition & 2 deletions dorado/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
__version__ = "2.5.1"

__version__ = "2.5.3"

from . import lagrangian_walker
from . import parallel_routing
2 changes: 1 addition & 1 deletion dorado/particle_track.py
Original file line number Diff line number Diff line change
@@ -463,7 +463,7 @@ def generate_particles(self,
previous_walk_data : `dict`, optional
Dictionary of all prior x locations, y locations, and travel
times. This input parameter should only be used if 'new' or
'indpendent' walk data exists (e.g. data loaded from a .json
'independent' walk data exists (e.g. data loaded from a .json
file). Otherwise the walk data stored in `self.walk_data` is
likely to contain the previous information. Order of indices is
previous_walk_data[field][particle][iter], where e.g.
15 changes: 8 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import os
from setuptools import setup, find_packages
from dorado import __version__

setup(
name = 'pydorado',
version = __version__,
version = '2.5.3',
license = 'MIT',
description = 'dorado - Lagrangian particle routing routine via weighted random walks',
author = 'J. Hariharan, K. Wright, P. Passalacqua',
@@ -13,11 +12,13 @@
packages = find_packages(exclude=['*.tests']),
package_data = {'' : ['*.txt', '*.npz']},
long_description = 'See project webpage for details: https://github.com/passaH2O/dorado',
classifiers = ['Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9'],
classifiers = [
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11'],
install_requires = ['numpy','matplotlib','scipy',
'future','tqdm'],
)
11 changes: 7 additions & 4 deletions tests/test_examplecases.py
Original file line number Diff line number Diff line change
@@ -51,8 +51,9 @@ def test_few_steps_RCM(self):
# check all positions and times
assert all_walk_data['xinds'][0] == [16, 17, 18, 19]
assert all_walk_data['yinds'][0] == [140, 141, 141, 141]
assert all_walk_data['travel_times'][0] == \
[0, 7007593448.337235, 10439964733.462337, 13698473384.876724]
assert all_walk_data['travel_times'][0] == pytest.approx(
[0, 7007593448.337235, 10439964733.462337, 13698473384.876724],
rel=1e-6)

def test_set_time_RCM_previousdata(self):
'''
@@ -76,7 +77,8 @@ def test_set_time_RCM_previousdata(self):
# check all positions and times
assert all_walk_data['xinds'][0] == [16, 17]
assert all_walk_data['yinds'][0] == [140, 141]
assert all_walk_data['travel_times'][0] == [0, 7007593448.337235]
assert all_walk_data['travel_times'][0] == pytest.approx(
[0, 7007593448.337235], rel=1e-6)

def test_set_time_RCM(self):
'''
@@ -101,7 +103,8 @@ def test_set_time_RCM(self):
# check all positions and times
assert all_walk_data['xinds'][0] == [16, 17]
assert all_walk_data['yinds'][0] == [140, 141]
assert all_walk_data['travel_times'][0] == [0, 7007593448.337235]
assert all_walk_data['travel_times'][0] == pytest.approx(
[0, 7007593448.337235], rel=1e-6)


class TestANUGA: