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

Integration branch #799

Closed
wants to merge 69 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
58feb9f
Add diagnostic plots
guyer Apr 13, 2021
af36edb
Smooth gmsh meshes to improve orthogonality
guyer Apr 13, 2021
db819ac
Revert "Add diagnostic plots"
guyer Apr 13, 2021
a3ed5b4
Smooth some more
guyer Apr 13, 2021
e328ed1
Install conda in environment
wd15 Apr 13, 2021
850ffa4
Create env with conda, before conda-forge install
wd15 Apr 13, 2021
7b933b9
Enable remote desktop debugging
guyer Apr 14, 2021
edbccd0
Attempt to enable RDP
guyer Apr 14, 2021
350bb86
Trying to make RDP work for real
guyer Apr 15, 2021
8673ad6
Ping appveyor
guyer Apr 15, 2021
092a7ef
Prioritize Py3k
guyer Apr 15, 2021
42deacc
Clobber all builds but Py3k
guyer Apr 15, 2021
9e7b0eb
Revert "Revert "Add diagnostic plots""
guyer Apr 15, 2021
45aa553
Hold RDP open
guyer Apr 15, 2021
c34eaad
Ping appveyor
guyer Apr 15, 2021
472e116
Revert "Revert "Revert "Add diagnostic plots"""
guyer Apr 15, 2021
39a5831
Revert "Clobber all builds but Py3k"
guyer Apr 15, 2021
52c361f
Disable RDP
guyer Apr 15, 2021
c88ae2b
Smooth a lot
guyer Apr 15, 2021
517062e
Be explicit about python version
guyer Apr 15, 2021
777c1e6
Create, then install
guyer Apr 15, 2021
33b2147
Specify defaults channel
guyer Apr 15, 2021
d2d81f4
Bump the cache
guyer Apr 15, 2021
def9c99
Install everything at create
guyer Apr 15, 2021
085cbb6
Switch to miniconda3 docker image, even for Python 2.7
guyer Apr 16, 2021
d073e38
Move trilinos tests to Py3k
guyer Apr 17, 2021
d4d1c3d
Manually install pytrilinos
guyer Apr 17, 2021
0219dde
Shift trilinos tests to Py3k on CircleCI
guyer Apr 17, 2021
7cdfaf9
Replace deprecated np.bool with bool
guyer Apr 17, 2021
afaa6f0
Merge branch 'circleSquare_broken' into integration
guyer Apr 18, 2021
e1e14c5
Merge branch 'np_bool_is_deprecated' into integration
guyer Apr 18, 2021
c91f6c6
Merge branch 'travis_conda_trilinos_broken' into integration
guyer Apr 18, 2021
b2694ed
Silence deprecation warning in skfmm
guyer Apr 19, 2021
adf3909
Merge branch 'np_bool_is_deprecated' into integration
guyer Apr 19, 2021
c475ce0
Describe deprecation exception
guyer Apr 19, 2021
a007c16
Silence deprecation warning in tvtk
guyer Apr 19, 2021
e66cca5
Merge branch 'np_bool_is_deprecated' into integration
guyer Apr 19, 2021
cb76f2f
Silence deprecation warning in tvtk
guyer Apr 19, 2021
39b1d23
Merge branch 'np_bool_is_deprecated' into integration
guyer Apr 19, 2021
8c76a4a
Revert "Silence deprecation warning in tvtk"
guyer Apr 19, 2021
0cff72c
Revert "Silence deprecation warning in tvtk"
guyer Apr 19, 2021
b959f27
Test appveyor on newer python
guyer Apr 19, 2021
2485021
Merge branch 'np_bool_is_deprecated' into integration
guyer Apr 19, 2021
75f3b55
Step back to Python 3.8 on appveyor
guyer Apr 19, 2021
18ac84f
Merge branch 'np_bool_is_deprecated' into integration
guyer Apr 19, 2021
c22ba3d
Remove defaults channel
guyer Apr 19, 2021
dd7289e
Merge branch 'np_bool_is_deprecated' into integration
guyer Apr 19, 2021
97d1fd9
Reintroduce defaults channel for Python 2.7
guyer Apr 19, 2021
49cc343
Merge branch 'np_bool_is_deprecated' into integration
guyer Apr 19, 2021
071f460
Install gmsh after activating environment
guyer Apr 21, 2021
8637d0e
Switch to mamba to try to speed things up
guyer Apr 22, 2021
8c113a1
Explicitly install desired version of gmsh
guyer Apr 22, 2021
3cec929
Change more conda install to mamba install
guyer Apr 22, 2021
ed8d3d1
Install mamba everywhere
guyer Apr 22, 2021
fc143a7
Kick the cache
guyer Apr 23, 2021
02da32a
Add note about using mamba
guyer Apr 23, 2021
6e50f9b
Add links to conda slowness
guyer Apr 23, 2021
c5dee87
Isolate offending test
guyer Apr 23, 2021
16f7e1e
Log debug information in polyxtal
guyer Apr 23, 2021
4129393
Restrict CircleCI tests to example polyxtal
guyer Apr 23, 2021
264184d
Merge branch 'issue796-examples_phase_polyxtal_freezes_on_CircleCI_wi…
guyer Apr 23, 2021
66f22b4
Merge branch 'issue800-CircleCI_conda2_env_is_really_slow_and_ends_up…
guyer Apr 23, 2021
e32019d
Ping the build
guyer Apr 23, 2021
5e597a4
Actually install fipy to enable running single test
guyer Apr 23, 2021
0615833
Merge branch 'issue796-examples_phase_polyxtal_freezes_on_CircleCI_wi…
guyer Apr 23, 2021
48a8a86
Timestamp log output
guyer Apr 23, 2021
4a4d050
Merge branch 'issue796-examples_phase_polyxtal_freezes_on_CircleCI_wi…
guyer Apr 23, 2021
cfb3270
Report solver and preconditioner
guyer Apr 24, 2021
f7c2783
Merge branch 'issue796-examples_phase_polyxtal_freezes_on_CircleCI_wi…
guyer Apr 24, 2021
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
133 changes: 68 additions & 65 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ commands:
- run:
name: Create Conda Environment
command: |
conda create -v --quiet --prefix << parameters.condaenv >> --show-channel-urls --channel conda-forge "<< parameters.python >>" << parameters.packages >> gmsh
mamba create -v --quiet --prefix << parameters.condaenv >> --show-channel-urls --channel conda-forge "<< parameters.python >>" << parameters.packages >>
source activate ~/project/<< parameters.condaenv >>
conda remove --quiet --channel conda-forge --force fipy
mamba remove --quiet --channel conda-forge --force fipy
pip install scikit-fmm

test_fipy:
Expand Down Expand Up @@ -87,7 +87,8 @@ commands:
if [[ ! -z "${FIPY_INLINE}" ]]; then
<< parameters.mpirun >> python setup.py test > /dev/null 2>&1 || true;
fi
<< parameters.mpirun >> python setup.py test --deprecation-errors
python setup.py develop
<< parameters.mpirun >> python examples/phase/test.py

- store_artifacts:
path: test-reports
Expand Down Expand Up @@ -147,7 +148,7 @@ commands:
paths:
- /opt/conda
- /root/.cache/pip
key: v13-dependencies-{{ arch }}-<< parameters.condaenv >>
key: v14-dependencies-{{ arch }}-<< parameters.condaenv >>

restore_conda_cache:
description: "Restore cache holding conda and pip"
Expand All @@ -160,9 +161,9 @@ commands:
steps:
- restore_cache:
keys:
- v13-dependencies-{{ arch }}-<< parameters.condaenv >>
- v14-dependencies-{{ arch }}-<< parameters.condaenv >>
# fallback to using the latest cache if no exact match is found
- v13-dependencies-
- v14-dependencies-

install_dependencies:
steps:
Expand All @@ -173,6 +174,7 @@ commands:
apt-get --yes install build-essential
conda config --set always_yes yes --set changeps1 no
conda config --remove channels defaults
conda install --channel conda-forge mamba

remove_extracted_conda_packages:
description: "force conda to download packages into the cache and then
Expand Down Expand Up @@ -248,7 +250,7 @@ jobs:
steps:
- install_conda_packages:
python: "python=2.7"
packages: "fipy \"traitsui<7.0.0\""
packages: "fipy \"traitsui<7.0.0\" \"gmsh<4.0\""
condaenv: "test-environment-27"

conda3_env:
Expand All @@ -257,7 +259,7 @@ jobs:
steps:
- install_conda_packages:
python: "python=3"
packages: "fipy pytrilinos"
packages: "fipy pytrilinos gmsh"
condaenv: "test-environment-36"

pip_env:
Expand Down Expand Up @@ -433,7 +435,7 @@ jobs:
name: Lint
command: |
source activate ~/project/<< parameters.condaenv >>
conda install --channel conda-forge black
mamba install --channel conda-forge black
black --target-version py27 --fast --diff --check setup.py

pyspelling:
Expand All @@ -457,7 +459,7 @@ jobs:
name: Spell Check
command: |
source activate ~/project/<< parameters.condaenv >>
conda install --channel conda-forge hunspell
mamba install --channel conda-forge hunspell
pip install pyspelling
wget -O en_US.aff https://cgit.freedesktop.org/libreoffice/dictionaries/plain/en/en_US.aff?id=a4473e06b56bfe35187e302754f6baaa8d75e54f
wget -O en_US.dic https://cgit.freedesktop.org/libreoffice/dictionaries/plain/en/en_US.dic?id=a4473e06b56bfe35187e302754f6baaa8d75e54f
Expand Down Expand Up @@ -488,10 +490,10 @@ jobs:
name: install sphinx
command: |
source activate ~/project/<< parameters.condaenv >>
conda install --channel conda-forge sphinx future
mamba install --channel conda-forge sphinx future
pip install 'sphinxcontrib-bibtex<=0.4.2'
pip install numpydoc
conda install --channel conda-forge matplotlib pandas imagemagick
mamba install --channel conda-forge matplotlib pandas imagemagick

- build_html_docs:
condaenv: << parameters.condaenv >>
Expand Down Expand Up @@ -521,10 +523,10 @@ jobs:
name: install sphinx
command: |
source activate ~/project/<< parameters.condaenv >>
conda install --channel conda-forge sphinx future
mamba install --channel conda-forge sphinx future
pip install sphinxcontrib-bibtex
pip install numpydoc
conda install --channel conda-forge matplotlib pandas imagemagick
mamba install --channel conda-forge matplotlib pandas imagemagick

- run:
name: Install LaTeX
Expand Down Expand Up @@ -592,75 +594,76 @@ jobs:
path: ~/project/dist



workflows:
version: 2

test:
jobs:
- conda2_env
- conda3_env
# - build-27-docs:
# # - build-27-docs:
# # requires:
# # - conda2_env
# - pip_env
# - build-36-docs:
# requires:
# - conda3_env
# - pylint:
# requires:
# - conda2_env
- pip_env
- build-36-docs:
requires:
- conda3_env
- pylint:
requires:
- conda2_env
- flake8:
requires:
- conda2_env
- black:
requires:
- conda3_env
- pyspelling:
requires:
- conda3_env
- test-27-pysparse:
requires:
- conda2_env
# - test-27-inline:
# - flake8:
# requires:
# - conda2_env
# - test-27-scipy:
# - black:
# requires:
# - conda3_env
# - pyspelling:
# requires:
# - conda3_env
# - test-27-pysparse:
# requires:
# - conda2_env
- test-27-petsc-serial:
requires:
- conda2_env
- test-27-petsc-parallel:
# # - test-27-inline:
# # requires:
# # - conda2_env
- test-27-scipy:
requires:
- conda2_env
# - test-27-petsc-serial:
# requires:
# - conda2_env
# - test-27-petsc-parallel:
# requires:
# - conda2_env
- test-36-scipy:
requires:
- conda3_env
- test-36-trilinos-serial:
requires:
- conda3_env
- test-36-trilinos-parallel:
requires:
- conda3_env
# - test-36-trilinos-serial:
# requires:
# - conda3_env
# - test-36-trilinos-parallel:
# requires:
# - conda3_env
- test-36-petsc-serial:
requires:
- conda3_env
- test-36-petsc-parallel:
requires:
- conda3_env
- build-binaries:
requires:
- conda3_env
# - build-36-docs
# - pylint
# - flake8
# - black
# - pyspelling
# - test-27-pysparse
# - test-27-trilinos-serial
# - test-27-trilinos-parallel
# - test-27-petsc-serial
# - test-27-petsc-parallel
# - test-36-scipy
# - test-36-petsc-serial
# - test-36-petsc-parallel
# - test-36-petsc-parallel:
# requires:
# - conda3_env
# - build-binaries:
# requires:
# - conda3_env
# # - build-36-docs
# # - pylint
# # - flake8
# # - black
# # - pyspelling
# # - test-27-pysparse
# # - test-27-trilinos-serial
# # - test-27-trilinos-parallel
# # - test-27-petsc-serial
# # - test-27-petsc-parallel
# # - test-36-scipy
# # - test-36-petsc-serial
# # - test-36-petsc-parallel
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ before_install:
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda create --quiet --name test-environment --show-channel-urls --channel conda-forge python=$TRAVIS_PYTHON_VERSION fipy gmsh pytrilinos;
- conda install --channel conda-forge mamba
- mamba create --quiet --name test-environment --show-channel-urls --channel conda-forge python=$TRAVIS_PYTHON_VERSION fipy pytrilinos;
- source activate test-environment
- conda remove --quiet --channel conda-forge --force fipy
- mamba remove --quiet --channel conda-forge --force fipy
- if [[ $PY3K -eq 0 ]]; then
conda install --channel conda-forge "traitsui<7.0.0";
mamba install --channel conda-forge "traitsui<7.0.0" "gmsh<4.0";
else
mamba install --channel conda-forge gmsh;
fi
# Useful for debugging any issues with conda
- conda info -a
Expand Down
10 changes: 10 additions & 0 deletions INSTALLATION.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ Recommended Method

* move on to :ref:`USAGE`.

.. note::

conda_ can be
`quite <https://www.anaconda.com/blog/understanding-and-improving-condas-performance>`_
`slow <https://medium.com/@marius.v.niekerk/conda-metachannel-f962241c9437>`_
to resolve all dependencies when performing
an installation. You may wish to consider using the alternative
mamba_ installation manager to speed things up.

.. note::

On Linux_ and `Mac OS X`_, you should have a pretty complete system
Expand All @@ -141,6 +150,7 @@ Recommended Method
.. _Windows: http://www.microsoft.com/windows/
.. |CondaForge| image:: https://anaconda.org/conda-forge/fipy/badges/installer/conda.svg
.. _CondaForge: https://anaconda.org/conda-forge/fipy
.. _mamba: https://github.com/mamba-org/mamba


--------------
Expand Down
37 changes: 34 additions & 3 deletions examples/phase/polyxtal.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@

We start with a regular 2D Cartesian mesh

>>> import logging
>>> logging.basicConfig(level=logging.DEBUG, format='%(asctime)s:%(levelname)s:%(message)s')

>>> logging.debug("begin")

>>> from fipy import CellVariable, Variable, ModularVariable, Grid2D, TransientTerm, DiffusionTerm, ImplicitSourceTerm, MatplotlibViewer, Matplotlib2DGridViewer, MultiViewer
>>> from fipy.tools import numerix
>>> dx = dy = 0.025
Expand All @@ -22,6 +27,8 @@
... nx = ny = 200
>>> mesh = Grid2D(dx=dx, dy=dy, nx=nx, ny=ny)

>>> logging.debug("Grid2D initialized")

and we'll take fixed timesteps

>>> dt = 5e-4
Expand All @@ -41,6 +48,8 @@
>>> theta = ModularVariable(name=r'$\theta$', mesh=mesh, hasOld=True)
>>> theta.value = -numerix.pi + 0.0001

>>> logging.debug("CellVariables initialized")

The ``hasOld`` flag causes the storage of the value of variable from the
previous timestep. This is necessary for solving equations with
non-linear coefficients or for coupling between PDEs.
Expand Down Expand Up @@ -132,6 +141,8 @@
... * (1 - phase)
... - (2 * s + epsilon**2 * thetaMag) * thetaMag))

>>> logging.debug("Equations initialized")

The governing equation for orientation is given by

.. math::
Expand Down Expand Up @@ -188,6 +199,8 @@
... phase[seed] = 1.
... theta[seed] = numerix.pi * (2 * orientation - 1)

>>> logging.debug("Initial condition set")

and quench the entire simulation domain below the melting point

>>> dT.setValue(-0.5)
Expand Down Expand Up @@ -312,15 +325,33 @@
>>> save_interval = 0.002
>>> save_at = save_interval

# >>> from fipy import solvers
# >>> if solvers.solver == "scipy":
# ... solver = solvers.LinearGMRESSolver()
# ... else:
# ... solver = None

>>> solver = None

>>> theta_solver = thetaEq.getDefaultSolver()
>>> logging.debug("theta: {} {}".format(theta_solver, theta_solver.preconditioner))
>>> phase_solver = phaseEq.getDefaultSolver()
>>> logging.debug("phase: {} {}".format(phase_solver, phase_solver.preconditioner))
>>> heat_solver = heatEq.getDefaultSolver()
>>> logging.debug("heat: {} {}".format(heat_solver, heat_solver.preconditioner))

>>> while elapsed < total_time:
... if elapsed > 0.3:
... q.value = 100
... phase.updateOld()
... dT.updateOld()
... theta.updateOld()
... thetaEq.solve(theta, dt=dt)
... phaseEq.solve(phase, dt=dt)
... heatEq.solve(dT, dt=dt)
... res_theta = thetaEq.sweep(theta, dt=dt, solver=solver)
... logging.debug("elapsed={}, theta residual = {}".format(elapsed, res_theta))
... res_phase = phaseEq.sweep(phase, dt=dt, solver=solver)
... logging.debug("elapsed={}, phase residual = {}".format(elapsed, res_phase))
... res_heat = heatEq.sweep(dT, dt=dt, solver=solver)
... logging.debug("elapsed={}, heat residual = {}".format(elapsed, res_heat))
... elapsed += dt
... if __name__ == "__main__" and elapsed >= save_at:
... timer.set_text("t = %.3f" % elapsed)
Expand Down
20 changes: 10 additions & 10 deletions examples/phase/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

def _suite():
return _LateImportDocTestSuite(testModuleNames = (
'impingement.test',
'missOrientation.test',
# 'impingement.test',
# 'missOrientation.test',
),
docTestModuleNames = (
'binary',
'anisotropyOLD',
'anisotropy',
'quaternary',
'simple',
'symmetry',
'binaryCoupled',
# 'binary',
# 'anisotropyOLD',
# 'anisotropy',
# 'quaternary',
# 'simple',
# 'symmetry',
# 'binaryCoupled',
'polyxtal',
'polyxtalCoupled'
# 'polyxtalCoupled'
),
base = __name__)

Expand Down