Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

want new version please #4

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Set up Python 3.x
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -25,7 +25,7 @@ jobs:
pip install ipython
pip install ipykernel
pip install numpy
pip install matplotlib
pip install matplotlib==3.3.1
- name: Build and test documentation
run: |
(cd docs && make docs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ tidal-flow-calculator.

To simulate passive particle transport we will use the Lagrangian-based
transport model `dorado <https://github.com/passaH2O/dorado>`__. We can
install dorado by typing ``pip install pydorado`` from the command line.
install dorado by typing ``pip install pydorado`` from the command
line.

.. code:: ipython3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ Plot final water depths


Questions to think about
========================
------------------------

1. Now you can see where there is high erosion occuring - why might this
spot have erosion? What might change the pattern and location of
Expand Down
3 changes: 3 additions & 0 deletions docs/source/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Examples

Examples using the tidal flood component. For the raw jupyter notebook files and other associated content, please refer to our `repository <https://github.com/espin-2020/CoastalTeam>`_.

There is a Google Colab notebook associated with the "Tides on a randomly vegetated field" example, it is available `here <https://colab.research.google.com/drive/1x0ZiS6B5CVhyi5UPfKK0ooIkC5rV5Iod?usp=sharing>`_.


.. toctree::
:maxdepth: 1

Expand Down
14 changes: 12 additions & 2 deletions passive_particles/HomogeneousField2D.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion passive_particles/RandomField2D.ipynb

Large diffs are not rendered by default.

22 changes: 14 additions & 8 deletions passive_particles/particletransport.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def init_particles(init_x, init_y, Np_tracer, grid_spacing, gridded_vals):

"""
# create class
params = pt.params()
params = pt.modelParams()
# populate with required parameters
params.seed_xloc = init_y
params.seed_yloc = init_x
Expand Down Expand Up @@ -72,7 +72,11 @@ def tidal_particles(params, tide_period, n_tide_periods, plot_grid=None):

"""
# define the particle
particle = pt.Particle(params)
particle = pt.Particles(params)
# generate a set of particles to route around
particle.generate_particles(params.Np_tracer,
params.seed_xloc,
params.seed_yloc)
# record each 1/2 tidal cycle so each ebb and flood
for i in range(0, int(2*n_tide_periods)):
if i == 0:
Expand All @@ -83,16 +87,18 @@ def tidal_particles(params, tide_period, n_tide_periods, plot_grid=None):
# ebb tide
params.u = params.ex
params.v = params.ey
particle = pt.Particle(params)
walk_data = particle.run_iteration(previous_walk_data=walk_data,
target_time=tide_period/2*(i+1))
particle = pt.Particles(params)
particle.generate_particles(0, [], [],
previous_walk_data=walk_data)
walk_data = particle.run_iteration(target_time=tide_period/2*(i+1))
else:
# flood tide
params.u = params.fx
params.v = params.fy
particle = pt.Particle(params)
walk_data = particle.run_iteration(previous_walk_data=walk_data,
target_time=tide_period/2*(i+1))
particle = pt.Particles(params)
particle.generate_particles(0, [], [],
previous_walk_data=walk_data)
walk_data = particle.run_iteration(target_time=tide_period/2*(i+1))

# plot and save particle locations
if plot_grid is None:
Expand Down