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

Tweak documentation #991

Merged
merged 4 commits into from
Jan 10, 2024
Merged
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
FiPy.egg-info
MANIFEST.in
dist/
documentation/_build/
generated/
*.logamgx
*.dump.gz
Expand Down
2 changes: 1 addition & 1 deletion examples/cahnHilliard/tanh1D.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
If we are running interactively, we create a viewer to see the results

.. index::
module: fipy.viewers
pair: module; fipy.viewers

>>> if __name__ == '__main__':
... viewer = Viewer(vars=var, datamin=0., datamax=1.0)
Expand Down
2 changes: 1 addition & 1 deletion examples/convection/exponential1D/cylindricalMesh1D.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
If the problem is run interactively, we can view the result:

.. index::
module: fipy.viewers
pair: module; fipy.viewers

>>> if __name__ == '__main__':
... viewer = Viewer(vars=var)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
If the problem is run interactively, we can view the result:

.. index::
module: fipy.viewers
pair: module; fipy.viewers

>>> if __name__ == '__main__':
... viewer = Viewer(vars=var)
Expand Down
2 changes: 1 addition & 1 deletion examples/convection/exponential1D/mesh1D.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
If the problem is run interactively, we can view the result:

.. index::
module: fipy.viewers
pair: module; fipy.viewers

>>> if __name__ == '__main__':
... viewer = Viewer(vars=var)
Expand Down
2 changes: 1 addition & 1 deletion examples/convection/exponential1DSource/mesh1D.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
If the problem is run interactively, we can view the result:

.. index::
module: fipy.viewers
pair: module; fipy.viewers

>>> if __name__ == '__main__':
... viewer = Viewer(vars=var)
Expand Down
2 changes: 1 addition & 1 deletion examples/convection/exponential2D/cylindricalMesh2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
If the problem is run interactively, we can view the result:

.. index::
module: fipy.viewers
pair: module; fipy.viewers

>>> if __name__ == '__main__':
... viewer = Viewer(vars=var)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
If the problem is run interactively, we can view the result:

.. index::
module: fipy.viewers
pair: module; fipy.viewers

>>> if __name__ == '__main__':
... viewer = Viewer(vars=var)
Expand Down
10 changes: 5 additions & 5 deletions examples/diffusion/circle.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
Using this mesh, we can construct a solution variable

.. index::
object: fipy.variables.cellVariable.CellVariable
pair: object; fipy.variables.cellVariable.CellVariable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this supposed to do? When I go to the documentation, I'm not seeing anything to click on or anything at that point in the documentation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you look in the index for fipy.variables.cellVariable.CellVariable, there's a link back to https://pages.nist.gov/fipy/en/tweak_documentation/generated/examples.diffusion.circleQuad.html#index-0.

It's probably stupid. I did it a long time ago and was just bringing the syntax up-to-date.


>>> phi = CellVariable(name = "solution variable",
... mesh = mesh,
Expand All @@ -63,8 +63,8 @@
We set up a transient diffusion equation

.. index::
object: fipy.terms.transientTerm.TransientTerm
object: fipy.terms.implicitDiffusionTerm.DiffusionTerm
pair: object; fipy.terms.transientTerm.TransientTerm
pair: object; fipy.terms.implicitDiffusionTerm.DiffusionTerm

>>> D = 1.
>>> eq = TransientTerm() == DiffusionTerm(coeff=D)
Expand Down Expand Up @@ -98,7 +98,7 @@
another application, we could export tab-separated-values with

.. index::
object: fipy.viewers.tsvViewer.TSVViewer
pair: object; fipy.viewers.tsvViewer.TSVViewer

::

Expand All @@ -124,7 +124,7 @@
... mesh=mesh) # doctest: +GMSH

.. index::
module: scipy
pair: module; scipy
single: sqrt; arcsin; cos

>>> x0 = radius * numerix.cos(numerix.arcsin(y)) # doctest: +GMSH
Expand Down
10 changes: 5 additions & 5 deletions examples/diffusion/circleQuad.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
Using this mesh, we can construct a solution variable

.. index::
object: fipy.variables.cellVariable.CellVariable
pair: object; fipy.variables.cellVariable.CellVariable

>>> phi = CellVariable(name = "solution variable",
... mesh = mesh,
Expand All @@ -64,8 +64,8 @@
We set up a transient diffusion equation

.. index::
object: fipy.terms.transientTerm.TransientTerm
object: fipy.terms.implicitDiffusionTerm.DiffusionTerm
pair: object; fipy.terms.transientTerm.TransientTerm
pair: object; fipy.terms.implicitDiffusionTerm.DiffusionTerm

>>> D = 1.
>>> eq = TransientTerm() == DiffusionTerm(coeff=D)
Expand Down Expand Up @@ -97,7 +97,7 @@
another application, we could export tab-separated-values with

.. index::
object: fipy.viewers.tsvViewer.TSVViewer
pair: object; fipy.viewers.tsvViewer.TSVViewer

::

Expand All @@ -123,7 +123,7 @@
... mesh=mesh) # doctest: +GMSH

.. index::
module: scipy
pair: module; scipy
single: sqrt; arcsin; cos

>>> x0 = radius * numerix.cos(numerix.arcsin(y)) # doctest: +GMSH
Expand Down
2 changes: 1 addition & 1 deletion examples/diffusion/mesh1D.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
viewers and the dimension of the mesh.

.. index::
module: fipy.viewers
pair: module; fipy.viewers

>>> phiAnalytical = CellVariable(name="analytical value",
... mesh=mesh)
Expand Down
2 changes: 1 addition & 1 deletion examples/diffusion/mesh20x20.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
We create a viewer to see the results

.. index::
module: fipy.viewers
pair: module; fipy.viewers

>>> if __name__ == '__main__':
... viewer = Viewer(vars=phi, datamin=0., datamax=1.)
Expand Down
2 changes: 1 addition & 1 deletion examples/diffusion/mesh20x20Coupled.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
We create a viewer to see the results

.. index::
module: fipy.viewers
pair: module; fipy.viewers

>>> if __name__ == '__main__':
... viewer = Viewer(vars=phi, datamin=0., datamax=1.)
Expand Down
2 changes: 1 addition & 1 deletion examples/diffusion/nthOrder/input4thOrder1D.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
If the problem is run interactively, we can view the result:

.. index::
module: fipy.viewers
pair: module; fipy.viewers

>>> if __name__ == '__main__':
... viewer = Viewer(vars=(var, analytical))
Expand Down
2 changes: 1 addition & 1 deletion examples/flow/stokesCavity.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
Set up the viewers,

.. index::
module: fipy.viewers
pair: module; fipy.viewers

>>> if __name__ == '__main__':
... viewer = Viewer(vars=(pressure, xVelocity, yVelocity, velocity),
Expand Down
2 changes: 1 addition & 1 deletion examples/levelSet/electroChem/gold.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
more complex mesh.

.. index::
module: gmsh
pair: module; gmsh

There are a few differences between the gold superfill model presented
in this example and in :mod:`examples.levelSet.electroChem.simpleTrenchSystem`.
Expand Down
2 changes: 1 addition & 1 deletion examples/levelSet/electroChem/howToWriteAScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
Build the mesh:

.. index::
module: fipy.tools.parser
pair: module; fipy.tools.parser

>>> from fipy.tools.parser import parse
>>> numberOfElements = parse('--numberOfElements', action='store',
Expand Down
2 changes: 1 addition & 1 deletion examples/levelSet/electroChem/leveler.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
construct the mesh.

.. index::
module: gmsh
pair: module; gmsh

This example models the case when suppressor, accelerator and leveler
additives are present in the electrolyte. The suppressor is
Expand Down
2 changes: 1 addition & 1 deletion examples/levelSet/electroChem/simpleTrenchSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
complex meshes requiring the :command:`gmsh` software.

.. index::
module: gmsh
pair: module; gmsh

.. this is kind of nasty, but reST tables can't handle what we need, particularly decimal alignment

Expand Down
2 changes: 1 addition & 1 deletion examples/phase/anisotropyOLD.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
the phase and temperature fields

.. index::
module: fipy.viewers
pair: module; fipy.viewers

>>> if __name__ == '__main__':
... phaseViewer = Viewer(vars=phase)
Expand Down
2 changes: 1 addition & 1 deletion examples/phase/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def deltaChemPot(phase, C, T):
>>> sharp.setValue(Cl, where=x >= L * fraction)

.. index::
module: fipy.viewers
pair: module; fipy.viewers

>>> if __name__ == '__main__':
... viewer = Viewer(vars=(phase, C, sharp),
Expand Down
4 changes: 2 additions & 2 deletions examples/phase/binaryCoupled.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def deltaChemPot(phase, C, T):
... [ 1. / C[0], -1. / C[1]]])

.. index::
module: scipy
pair: module; scipy

>>> try:
... from scipy.optimize import fsolve # doctest: +SCIPY
Expand All @@ -481,7 +481,7 @@ def deltaChemPot(phase, C, T):
>>> sharp.setValue(Cl, where=x >= L * fraction)

.. index::
module: fipy.viewers
pair: module; fipy.viewers

>>> if __name__ == '__main__':
... viewer = Viewer(vars=(phase, C, sharp),
Expand Down
6 changes: 3 additions & 3 deletions examples/phase/impingement/mesh20x20.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
with different initial conditions and a 2D mesh:

.. index::
module: fipy.tools.parser
pair: module; fipy.tools.parser

>>> from fipy.tools.parser import parse

Expand Down Expand Up @@ -158,7 +158,7 @@
by the phase

.. index::
module: fipy.viewers
pair: module; fipy.viewers

>>> if __name__ == '__main__':
... phaseViewer = Viewer(vars=phase, datamin=0., datamax=1.)
Expand Down Expand Up @@ -227,7 +227,7 @@
We save the variables to disk.

.. index::
module: fipy.tools.dump
pair: module; fipy.tools.dump

>>> (f, filename) = dump.write({'phase' : phase, 'theta' : theta}, extension = '.gz')

Expand Down
2 changes: 1 addition & 1 deletion examples/phase/impingement/mesh40x1.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
and orientation variables.

.. index::
module: fipy.viewers
pair: module; fipy.viewers

.. index::
single: :math:`\pi`
Expand Down
2 changes: 1 addition & 1 deletion examples/phase/quaternary.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@
If we're running interactively, we create a viewer

.. index::
module: viewers
pair: module; viewers

>>> if __name__ == '__main__':
... viewer = Viewer(vars=([phase]
Expand Down
4 changes: 2 additions & 2 deletions examples/phase/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
If we are running interactively, we'll want a viewer to see the results

.. index::
module: fipy.viewers
pair: module; fipy.viewers

>>> from fipy import input
>>> if __name__ == '__main__':
Expand Down Expand Up @@ -465,7 +465,7 @@
thickness

.. index::
module: scipy
pair: module; scipy

>>> try:
... def tanhResiduals(p, y, x, t):
Expand Down
2 changes: 1 addition & 1 deletion examples/updating/update0_1to1_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
or

.. index::
module: fipy.numerix
pair: module; fipy.numerix

>>> axis = 0
>>> x = mesh.getCellCenters()[:, axis]
Expand Down
3 changes: 2 additions & 1 deletion fipy/terms/abstractConvectionTerm.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def __init__(self, coeff=1.0, var=None):

Parameters
----------
coeff : The `Term`'s coefficient value.
coeff : :class:`~fipy.variables.meshVariable.MeshVariable`
The :class:`~fipy.terms.term.Term`'s coefficient value.
"""
if self.__class__ is _AbstractConvectionTerm:
raise AbstractBaseClassError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def plot(self, matrix, RHSvector, log='auto'):
import tempfile
import os

if "print" in os.environ['FIPY_DISPLAY_MATRIX'].lower().split():
if "print" in os.environ.get('FIPY_DISPLAY_MATRIX', '').lower().split():
print("-"*75)
print(self.title)
print("-"*75)
Expand Down
2 changes: 1 addition & 1 deletion fipy/viewers/matplotlibViewer/matplotlibStreamViewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(self, vars, title=None, log=False, limits={}, axes=None, figaspect=
desired aspect ratio of figure. If arg is a number, use that aspect
ratio. If arg is `auto`, the aspect ratio will be determined from
the Variable's mesh.
density : float or (float, float), optional
density : float or tuple of float, optional
Controls the closeness of streamlines. When ``density = 1``,
the domain is divided into a 30x30 grid. *density* linearly
scales this grid. Each cell in the grid can have, at most, one
Expand Down
Loading