Skip to content

Python 3 #1114

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

Merged
merged 63 commits into from
Jul 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
261c0b4
First guess at switching to venv
dham Jul 19, 2017
31cd05b
accidental space
dham Jul 19, 2017
8061b6e
remove legacy hacks
dham Jul 20, 2017
a6fe5b3
idiot-proofing
dham Jul 20, 2017
d39a660
Decode subprocess output strings before logging
dham Jul 20, 2017
d986f93
remove more legacy crud
dham Jul 20, 2017
6f490d4
idiv rename
dham Jul 20, 2017
f355185
don't pass parameters to Object.__new__
dham Jul 20, 2017
4674019
fecking unicode.
dham Jul 20, 2017
3c9d48e
fix flake8
miklos1 Jul 24, 2017
f344c1e
map has become lazy
miklos1 Jul 24, 2017
50cb035
fix firedrake-status
miklos1 Jul 24, 2017
7be3726
numpy.prod returns np.int64, not int
miklos1 Jul 24, 2017
22ecb7e
removed dict methods
miklos1 Jul 24, 2017
cc18065
probably accidental closure
miklos1 Jul 24, 2017
032b94d
fix test cases
miklos1 Jul 24, 2017
5f8976a
fix multigrid
miklos1 Jul 24, 2017
91c8fc1
fix test cases
miklos1 Jul 24, 2017
da609d6
changing dict during iteration
miklos1 Jul 24, 2017
825c0e3
fix pvd output
miklos1 Jul 24, 2017
70ab6a7
fix int >= None in slate
miklos1 Jul 24, 2017
67bdd1f
fix pylit
miklos1 Jul 24, 2017
d83fb2f
update print statement in demos
miklos1 Jul 24, 2017
41b0287
tiny plot fix
miklos1 Jul 24, 2017
e56fea5
No longer need glpk
wence- Jul 25, 2017
800d97f
Reinstate rebuild-script and fix firedrake-update
wence- Jul 25, 2017
339fe8d
remove underscore options
miklos1 Jul 25, 2017
ed761f8
fix JSON option name
miklos1 Jul 25, 2017
c8f595a
attempt to update required Python packages
miklos1 Jul 25, 2017
b8ba241
Remove old CI control files
wence- Jul 26, 2017
be241c9
install: Workaround debian ensurepip issue
wence- Jul 26, 2017
d2d2986
jenkins: Remove unnecessary env var
wence- Jul 26, 2017
0aa80bc
jenkins: Temporary workaround for pytest-dev/pytest#920
wence- Jul 26, 2017
d3c2476
jenkins: dump install log on failure
wence- Jul 26, 2017
9d17ffa
demos: Minor rst formatting
wence- Jul 26, 2017
1aed75e
install: Handle SLEPC_DIR like PETSC_DIR
wence- Jul 26, 2017
e649482
install: Require that we are run with python >= 3.5
wence- Jul 26, 2017
7584697
jenkins: Work around shebang line length limits
wence- Jul 26, 2017
9b3ea22
Missing realpath in update mode
dham Jul 26, 2017
2f52f66
only run package installation the second time
dham Jul 26, 2017
5f8e89e
Turns out the old way was safer
dham Jul 26, 2017
ef7023a
Defuturize all modules
wence- Jul 26, 2017
4919326
Defuturize firedrake-clean/firedrake-status
wence- Jul 26, 2017
fb4ea4f
py3ise firedrake-zenodo
wence- Jul 26, 2017
a0c8f7b
Add --honour-petsc-dir to firedrake-zenodo
wence- Jul 26, 2017
4bbc092
Desix all modules
wence- Jul 26, 2017
d62c6d4
install: Remove get-pip.py after use
wence- Jul 26, 2017
583a55a
Python 3 install instructions and webpage fixes
dham Jul 26, 2017
2398bd1
jenkins: Work around shebang line length limits
wence- Jul 26, 2017
f3cc1d8
Documentation fixes
dham Jul 27, 2017
4aa1975
xfail app import tests for now
wence- Jul 27, 2017
6c2851d
install: Make libadjoint find the right python
wence- Jul 27, 2017
738d7d0
Remove singledispatch and six requirements
wence- Jul 27, 2017
eed616c
Add better version-checking for upgrade path
wence- Jul 27, 2017
4aa3531
fix one more print statement
miklos1 Jul 27, 2017
11b5a0d
Unified cache setup
dham Jul 28, 2017
c41a161
Merge pull request #1113 from firedrakeproject/unify_cache_dirs
wence- Jul 28, 2017
feb1a6a
Also use the new cache locations in firedrake-clean
dham Jul 28, 2017
9c18b2a
Safer test for upgrade trap
dham Jul 28, 2017
a89087f
Move version checks earlier
wence- Jul 28, 2017
d887c03
but not before mode is set
dham Jul 28, 2017
e365c6e
install: Correct success message for firedrake-update
wence- Jul 28, 2017
c5da773
docs: Note that Python2 is required to build PETSc
wence- Jul 28, 2017
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
91 changes: 0 additions & 91 deletions .drone.yml

This file was deleted.

77 changes: 0 additions & 77 deletions .travis.yml

This file was deleted.

18 changes: 8 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ pipeline {
label 'linux'
}
environment {
TEST_FILES = "tests/extrusion/test_facet_integrals_2D.py tests/extrusion/test_mixed_bcs.py tests/extrusion/test_steady_advection_2D_extr.py tests/multigrid/test_two_poisson_gmg.py tests/output tests/regression/test_facet_orientation.py tests/regression/test_matrix_free.py tests/regression/test_nested_fieldsplit_solves.py tests/regression/test_nullspace.py tests/regression/test_point_eval_api.py tests/regression/test_point_eval_cells.py tests/regression/test_point_eval_fs.py tests/regression/test_solving_interface.py tests/regression/test_steady_advection_2D.py"
PATH = "/usr/local/bin:/usr/bin:/bin"
CC = "mpicc"
FIREDRAKE_CI_TESTS = "1"
PYTHONHASHSEED = "12453221"
}
stages {
stage('Clean') {
Expand All @@ -21,9 +21,7 @@ pipeline {
sh 'mkdir tmp'
dir('tmp') {
timestamps {
sh 'pip install virtualenv'
sh '../scripts/firedrake-install --disable-ssh --minimal-petsc ${SLEPC} --adjoint --slope --install thetis --install gusto ${PACKAGE_MANAGER}'
sh '$HOME/.local/bin/virtualenv --relocatable firedrake'
sh '../scripts/firedrake-install --disable-ssh --minimal-petsc ${SLEPC} --adjoint --slope --install thetis --install gusto ${PACKAGE_MANAGER} || (cat firedrake-install.log && /bin/false)'
}
}
}
Expand All @@ -34,7 +32,7 @@ pipeline {
timestamps {
sh '''
. ./firedrake/bin/activate
pip install flake8
python -m pip install flake8
cd firedrake/src/firedrake
make lint
'''
Expand All @@ -50,11 +48,11 @@ make lint
. ./firedrake/bin/activate
export PYOP2_CACHE_DIR=${VIRTUAL_ENV}/pyop2_cache
export FIREDRAKE_TSFC_KERNEL_CACHE_DIR=${VIRTUAL_ENV}/tsfc_cache
firedrake-clean
pip install pytest-cov pytest-xdist
pip list
python $(which firedrake-clean)
python -m pip install pytest-cov pytest-xdist
python -m pip list
cd firedrake/src/firedrake
py.test -n 4 --cov firedrake -v tests
python -m pytest -n 4 --cov firedrake -v tests
'''
}
}
Expand All @@ -68,7 +66,7 @@ py.test -n 4 --cov firedrake -v tests
. ./firedrake/bin/activate
export PYOP2_CACHE_DIR=${VIRTUAL_ENV}/pyop2_cache
export FIREDRAKE_TSFC_KERNEL_CACHE_DIR=${VIRTUAL_ENV}/tsfc_cache
cd firedrake/src/dolfin-adjoint; py.test -n 4 -v tests_firedrake
cd firedrake/src/dolfin-adjoint; python -m pytest -n 4 -v tests_firedrake
'''
}
}
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ modules:

lint:
@echo " Linting firedrake codebase"
@flake8 firedrake
@python -m flake8 firedrake
@echo " Linting firedrake test suite"
@flake8 tests
@python -m flake8 tests
@echo " Linting firedrake scripts"
@flake8 scripts --filename=*
@python -m flake8 scripts --filename=*

clean:
@echo " Cleaning extension modules"
Expand Down Expand Up @@ -42,22 +42,22 @@ endif

test_regression: modules
@echo " Running non-extruded regression tests"
@py.test tests/regression $(PYTEST_ARGS)
@python -m pytest tests/regression $(PYTEST_ARGS)

test_extrusion: modules
@echo " Running extruded regression tests"
@py.test tests/extrusion $(PYTEST_ARGS)
@python -m pytest tests/extrusion $(PYTEST_ARGS)

test_demos: modules
@echo " Running test of demos"
@py.test tests/demos $(PYTEST_ARGS)
@python -m pytest tests/demos $(PYTEST_ARGS)

test: modules
@echo " Running all regression tests"
@py.test tests $(PYTEST_ARGS)
@python -m pytest tests $(PYTEST_ARGS)

alltest: modules lint test

shorttest: modules lint
@echo " Running short regression tests"
@py.test --short tests $(PYTEST_ARGS)
@python -m pytest --short tests $(PYTEST_ARGS)
4 changes: 2 additions & 2 deletions demos/DG_advection/DG_advection.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,14 @@ terminal. ::

if step % 20 == 0:
outfile.write(q)
print "t=", t
print("t=", t)

Finally, we display the normalised :math:`L^2` error, by comparing to the
initial condition. ::

L2_err = sqrt(assemble((q - q_init)*(q - q_init)*dx))
L2_init = sqrt(assemble(q_init*q_init*dx))
print L2_err/L2_init
print(L2_err/L2_init)

This demo can be found as a script in
`DG_advection.py <DG_advection.py>`__.
Expand Down
2 changes: 1 addition & 1 deletion demos/benney_luke/benney_luke.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ from piecewise quadratic functions to piecewise linears::
We are now ready to enter the main time iteration loop::

while t < T:
print t, abs((E-E0)/E0)
print(t, abs((E-E0)/E0))
t += dt

t_.assign(t)
Expand Down
2 changes: 1 addition & 1 deletion demos/camassa-holm/camassaholm.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ The energy can be computed and checked. ::

#
E = assemble((u0*u0 + alphasq*u0.dx(0)*u0.dx(0))*dx)
print "t = ", t, "E = ", E
print("t = ", t, "E = ", E)

To implement the timestepping algorithm, we just call the solver, and assign
``w1`` to ``w0``. ::
Expand Down
2 changes: 1 addition & 1 deletion demos/eigenvalues_QG_basinmodes/qgbasinmodes.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ and we gather the final eigenfunctions ::
We can now list and show plots for the eigenvalues and eigenfunctions
that were found. ::

print "Leading eigenvalue is:", lam
print("Leading eigenvalue is:", lam)

try:
from matplotlib import pyplot
Expand Down
6 changes: 3 additions & 3 deletions demos/extruded_shallow_water/test_extrusion_lsw.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
p_test = TestFunction(Xplot)
solve(p_trial * p_test * dx == p_0 * p_test * dx, p_plot)
file << p_plot, t
print t
print(t)

E_1 = assemble(0.5 * p_0 * p_0 * dx + 0.5 * dot(u_0, u_0) * dx)
print 'Initial energy', E_0
print 'Final energy', E_1
print('Initial energy', E_0)
print('Final energy', E_1)
2 changes: 1 addition & 1 deletion demos/helmholtz/helmholtz.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,6 @@ Alternatively, since we have an analytic solution, we can check the
:math:`L_2` norm of the error in the solution::

f.interpolate(cos(x*pi*2)*cos(y*pi*2))
print sqrt(assemble(dot(u - f, u - f) * dx))
print(sqrt(assemble(dot(u - f, u - f) * dx)))

A python script version of this demo can be found `here <helmholtz.py>`__.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ Linear mixed fluid-structure interaction system

.. rst-class:: emphasis

This tutorial is aimed to demonstrate the use of subdomain functionality and show how to describe a system consisting of multiple materials in Firedrake.
This tutorial demonstrates the use of subdomain
functionality and show how to describe a system consisting of
multiple materials in Firedrake.

The tutorial was contributed by `Tomasz Salwa <mailto:[email protected]>`__
and `Onno Bokhove <mailto:[email protected]>`__.
The tutorial was contributed by `Tomasz Salwa
<mailto:[email protected]>`__ and `Onno Bokhove
<mailto:[email protected]>`__.

The model considered consists of fluid with a free surface and an elastic solid. We will be using interchangeably notions of fluid/water and structure/solid/beam. For simplicity (and speed of computation) we consider a model in 2D, however it can be easily generalised to 3D. The starting point is the linearised version (domain is fixed) of the fully nonlinear variational principle. In non-dimensional units:

Expand Down Expand Up @@ -275,7 +278,7 @@ In the end, we proceed with the actual computation loop::

while t <= t_end + dt:
t += dt
print 'time = ', t * T
print('time = ', t * T)
# symplectic Euler scheme
LVS_phi_f.solve()
LVS_U_phi.solve()
Expand Down Expand Up @@ -304,7 +307,14 @@ A python script version of this demo can be found `here <linear_fluid_structure_

The mesh file is `here <L_domain.msh>`__. It can be generated with `gmsh <http://gmsh.info/>`__ from `this file <L_domain.geo>`__ with a command: gmsh -2 L_domain.geo.

The work is based on the article "Variational modelling of wave-structure interactions with an offshore wind-turbine mast" by Tomasz Salwa, Onno Bokhove and Mark Kelmanson :cite:`Salwa:2017`. The authors gratefully acknowledge funding from European Commission, Marie Curie Actions - Initial Training Networks (ITN), project number 607596.
.. rst-class:: emphasis

The work is based on the article "Variational modelling of
wave-structure interactions with an offshore wind-turbine mast" by
Tomasz Salwa, Onno Bokhove and Mark Kelmanson
:cite:`Salwa:2017`. The authors gratefully acknowledge funding from
European Commission, Marie Curie Actions - Initial Training
Networks (ITN), project number 607596.


.. rubric:: References
Expand Down
Loading