Home
last modified time | relevance | path

Searched full:python (Results 1 – 25 of 240) sorted by relevance

12345678910

/petsc/src/binding/petsc4py/docs/source/
H A Dpetsc_python_types.rst3 PETSc Python types
6 Here we discuss details about Python-aware PETSc types that can be used within the library.
10 The low-level, Cython implementation exposing the Python methods is in `src/petsc4py/PETSc/libpetsc…
16 PETSc Python matrix type
20 in Python through the `petsc4py.PETSc.Mat.Type.PYTHON` type.
37 PETSc Python preconditioner type
40 The protocol for the `petsc4py.PETSc.PC.Type.PYTHON` preconditioner is:
55 $ python mat.py -pc_type python -pc_python_type pc.myJacobi -ksp_view
63 type: python
64 Python: pc.myJacobi
[all …]
H A Dcontributing.rst9 We use cython-lint_ for Cython and ruff_ for Python source codes.
12 $ python -m pip install -r src/binding/petsc4py/conf/requirements-lint.txt
18 For Python code, run::
22 Python code can be auto-formatted using::
30 `unittest <https://docs.python.org/3/library/unittest.html>`_
36 $ python test/runtests.py -k test_xxx
39 you can test your additions by using the fully qualified name of the Python
42 $ python test/runtests.py -k test_xxx.class_name.method_name
H A Dinstall.rst11 $ python -m pip install petsc petsc4py
20 $ python -m pip install src/binding/petsc4py
25 $ PETSC_ARCH='arch-0:...:arch-N' python -m pip install src/binding/petsc4py
40 $ python test/runtests.py
48 $ python test/runtests.py -k test_optdb
54 $ python test/runtests.py --help
60 $ mpiexec -n 4 python test/runtests.py
71 $ python -m pip install -r src/binding/petsc4py/conf/requirements-docs.txt
82 Building the documentation requires Python 3.11 or later.
H A Dpetsc_options.rst12 .. code-block:: python
25 $ python foo.py -ksp_type gmres -ksp_gmres_restart 100 -ksp_view
31 $ PETSC_OPTIONS='-ksp_type gmres -ksp_gmres_restart 100 -ksp_view' python foo.py
35 .. code-block:: python
46 $ python foo.py -n 50 -alpha 8.8
50 The options database is accessible also as a Python dictionary, so that one can for instance overri…
52 .. code-block:: python
/petsc/src/sys/python/
H A Dpythonsys.c4 #define PETSC_PYTHON_EXE "python"
12 /* get the path for the Python interpreter executable */ in PetscPythonFindExecutable()
14 PetscCall(PetscOptionsGetString(NULL, NULL, "-python", pythonexe, len, &flag)); in PetscPythonFindExecutable()
20Python does not appear to have a universal way to indicate the location of Python dynamic library …
29 /* call Python to find out the name of the Python dynamic library */ in PetscPythonFindLibraryName()
35 …PetscCheck(fgets(pythonlib, (int)pl, fp), PETSC_COMM_SELF, PETSC_ERR_PLIB, "Python: bad output fro… in PetscPythonFindLibraryName()
38 SETERRQ(PETSC_COMM_SELF, PETSC_ERR_LIB, "Python: Aborted due to missing popen()"); in PetscPythonFindLibraryName()
68 … PetscCall(PetscInfo(NULL, "Looking for Python library with \"%s %s\"\n", pythonexe, cmdlines[i])); in PetscPythonFindLibrary()
72 PetscCall(PetscInfo(NULL, "Python library %s found %d\n", pythonlib, found)); in PetscPythonFindLibrary()
110 /* open the Python dynamic library */ in PetscPythonLoadLibrary()
[all …]
/petsc/config/BuildSystem/config/packages/
H A DPython.py19 …help.addArgument('PETSc', '-with-python-exec=<executable>', nargs.Arg(None, None, 'Python executab…
20 …help.addArgument('PETSc', '-with-python-exec-from-env=<executable>', nargs.Arg(None, None, 'Python
21 …help.addArgument('PETSc', '-have-numpy=<bool>', nargs.ArgBool(None, None, 'Whether numpy python mo…
25 '''determine python binary to use'''
26 if 'with-python-exec-from-env' in self.argDB:
27 …self.getExecutable(os.path.basename(self.argDB['with-python-exec-from-env']), getFullPath=0, resul…
28 if 'with-python-exec' in self.argDB:
29 … raise RuntimeError("You cannot provide both -with-python-exec and -with-python-exec-from-path")
30 elif 'with-python-exec' in self.argDB:
31 …self.getExecutable(self.argDB['with-python-exec'], getFullPath=1, resultName='pyexe', setMakeMacro…
[all …]
H A Dpetsc4py.py17 …PETSc', '-with-petsc4py=<bool>', nargs.ArgBool(None, False, 'Build PETSc Python bindings (petsc4py…
32 self.python = framework.require('config.packages.Python',self)
86 …newdir + archflags + cflags + ' PYTHONPATH=${PETSCPYTHONPATH} ' + self.python.pyexe + ' setup.py b…
87 …'MPICC=${PCC} ' + newdir + archflags + self.python.pyexe +' setup.py install --install-lib=' + ins…
97 …tensity 0 -error_output_stdout -malloc_dump ${PETSC_TEST_OPTIONS}', self.python.pyexe, os.path.joi…
99 self.python.path.add(installLibPath)
107 raise RuntimeError('petsc4py requires Python 3.6 at least')
113 if not getattr(self.python,pkg): npkgs.append(pkg)
115 raise RuntimeError('petsc4py requires Python with "%s" module(s) installed!\n'
117 …'or with "pip" using: %s -m pip install %s' % (" ".join(npkgs), self.python.pyexe, " ".join(npkgs)…
H A Dmpi4py.py19 self.python = framework.require('config.packages.Python',self)
54 …cleancmd = 'MPICC='+self.framework.getCompiler()+' '+archflags+self.python.pyexe+' setup.py clean…
65 …buildcmd = 'MPICC='+self.framework.getCompiler()+' '+archflags+cflags+self.python.pyexe+' setup.p…
70 …installcmd = 'MPICC='+self.framework.getCompiler()+' '+self.python.pyexe+' setup.py install --inst…
80 if not getattr(self.python,'numpy'):
81 …raise RuntimeError('mpi4py, in the context of PETSc,requires Python with numpy module installed.\n'
83 'or using: %s -m pip install %s' % (self.python.pyexe, 'numpy'))
93 …raise RuntimeError('mpi4py not found in default Python PATH! Suggest --download-mpi4py or --with-m…
101 self.python.path.add(installLibPath)
/petsc/src/binding/petsc4py/
H A Dmakefile9 PYTHON = python$(py) macro
16 ${PYTHON} setup.py config ${opt}
18 ${PYTHON} setup.py build ${opt}
20 ${VALGRIND} ${PYTHON} ${PWD}/test/runtests.py ${opt}
22 ${MPIEXEC} -n $* ${VALGRIND} ${PYTHON} ${PWD}/test/runtests.py ${opt}
26 ${PYTHON} setup.py build_src ${opt}
34 ${PYTHON} setup.py clean --all
47 ${PYTHON} setup.py install --prefix='' --user ${opt}
49 -${RM} -r $(shell ${PYTHON} -m site --user-site)/${package}
50 -${RM} -r $(shell ${PYTHON} -m site --user-site)/${package}-*-py*.egg-info
[all …]
H A DCHANGES.rst2 CHANGES: PETSc for Python
16 (Python Stable ABI) under Python 3.10+ (requires Cython 3.1+).
159 - Fix linker flags for Python from Fink.
199 - Add ``Object.handle`` property (C pointer as a Python integer). Can
215 - Now the ``Mat``/``PC``/``KSP``/``SNES``/``TS`` Python subtypes are
218 - Better interaction between Python garbage collector and PETSc
221 - Support for PEP 3118 and legacy Python's buffer interface.
253 - Workaround GIL-related APIs for non-threaded Python builds.
265 dependencies and Python dynamic loading.
310 - Removed the dependency on ``numpy.distutils``, just use core Python
[all …]
H A DREADME.rst2 PETSc for Python
8 Welcome to PETSc for Python. This package provides Python bindings for
22 .. _Python: https://www.python.org
/petsc/config/BuildSystem/config/
H A Dpython.py26 '''Check that Python.h is present'''
29 found = self.checkPreprocess('#include <Python.h>\n')
34 '''Analogous to checkLink(), but the Python includes and libraries are automatically provided'''
49 # Check for Python headers
52 raise RuntimeError('Unable to locate Python headers')
54 # Check for Python dynamic library
69 raise RuntimeError("Cannot locate Python dynamic libraries");
84 # Verify that the Python library is a shared library
86 …self.isShared = self.libraries.checkShared('#include <Python.h>\n', 'Py_Initialize', 'Py_IsInitial…
88Python shared library check failed, probably due to inability to link Python libraries or a bad in…
[all …]
/petsc/src/sys/classes/viewer/impls/python/
H A Dpythonviewer.c5 PetscViewerPythonSetType - Initialize a `PetscViewer` object implemented in Python.
11 - pyname - full dotted Python name [package].module[.{class|function}]
14 . -viewer_python_type <pyname> - python class
30 PetscViewerPythonGetType - Get the Python name of a `PetscViewer` object implemented in Python.
38 . pyname - full dotted Python name [package].module[.{class|function}]
76 PetscViewerPythonCreate - Create a `PetscViewer` object implemented in Python.
82 - pyname - full dotted Python name [package].module[.{class|function}]
103 …PETSC_VIEWER_PYTHON_ - Creates a Python `PetscViewer` shared by all MPI processes in a communicato…
133 PETSCVIEWERPYTHON - A viewer implemented using Python code
138 This is the parent viewer for any implemented in Python.
/petsc/src/mat/impls/python/
H A Dpythonmat.c4 MatPythonSetType - Initialize a `Mat` object implemented in Python.
10 - pyname - full dotted Python name [package].module[.{class|function}]
13 . -mat_python_type <pyname> - python class
29 MatPythonGetType - Get the Python name of a `Mat` object implemented in Python.
37 . pyname - full dotted Python name [package].module[.{class|function}]
53 MatPythonCreate - Create a `Mat` object implemented in Python.
63 - pyname - full dotted Python name [package].module[.{class|function}]
/petsc/src/binding/petsc4py/demo/legacy/bratu2d/
H A Dmakefile4 PYTHON=python macro
23 ${MPIEXEC} ${PYTHON} bratu2d.py -impl python
33 ${MPIEXEC} ${PYTHON} bratu2d.py -impl fortran
/petsc/src/tao/python/
H A Dpythontao.c4 TaoPythonSetType - Initialize a `Tao` object implemented in Python.
10 - pyname - full dotted Python name [package].module[.{class|function}]
13 . -tao_python_type <pyname> - python class
29 TaoPythonGetType - Get the type of a `Tao` object implemented in Python.
37 . pyname - full dotted Python name [package].module[.{class|function}]
/petsc/src/ts/impls/python/
H A Dpythonts.c4 TSPythonSetType - Initialize a `TS` object implemented in Python.
10 - pyname - full dotted Python name [package].module[.{class|function}]
13 . -ts_python_type <pyname> - python class
29 TSPythonGetType - Get the type of a `TS` object implemented in Python.
37 . pyname - full dotted Python name [package].module[.{class|function}]
/petsc/src/ksp/ksp/impls/python/
H A Dpythonksp.c4 KSPPythonSetType - Initialize a `KSP` object to a type implemented in Python.
10 - pyname - full dotted Python name [package].module[.{class|function}]
13 . -ksp_python_type <pyname> - python class
29 KSPPythonGetType - Get the type of a `KSP` object implemented in Python.
37 . pyname - full dotted Python name [package].module[.{class|function}]
/petsc/src/snes/impls/python/
H A Dpythonsnes.c4 SNESPythonSetType - Initialize a `SNES` object implemented in Python.
10 - pyname - full dotted Python name [package].module[.{class|function}]
13 . -snes_python_type <pyname> - python class
29 …SNESPythonGetType - Get the type of a `SNES` object implemented in Python set with `SNESPythonSetT…
37 . pyname - full dotted Python name [package].module[.{class|function}]
/petsc/src/ksp/pc/impls/python/
H A Dpythonpc.c4 PCPythonSetType - Initialize a `PC` object implemented in Python, a `PCPYTHON`.
10 - pyname - full dotted Python name [package].module[.{class|function}]
13 . -pc_python_type <pyname> - python class
29 PCPythonGetType - Get the type of a `PC` object implemented in Python, a `PCPYTHON`.
37 . pyname - full dotted Python name [package].module[.{class|function}]
/petsc/src/binding/petsc4py/demo/legacy/kspsolve/
H A Dmakefile4 PYTHON=python macro
18 ${MPIEXEC} ${PYTHON} ${SCRIPT1}.py
23 ${MPIEXEC} ${PYTHON} ${SCRIPT2}.py
/petsc/src/binding/petsc4py/demo/legacy/bratu3d/
H A Dmakefile4 PYTHON=python macro
17 ${MPIEXEC} ${PYTHON} bratu3d.py -fd -nx 7 -ny 8 -nz 9
21 ${MPIEXEC} ${PYTHON} bratu3d.py -mf -nx 9 -ny 8 -nz 7
/petsc/src/binding/petsc4py/demo/legacy/wrap-f2py/
H A Dmakefile4 PYTHON=python macro
20 ${PYTHON} ${SCRIPT}.py
27 ${PYTHON} setup.py -q build_ext --inplace
/petsc/lib/petsc/bin/maint/
H A Dvalidate-petsc4py.sh11 if [[ -z "${PYTHON}" ]]
13 PYTHON=python
29 ${PYTHON} -m petsc4py -help || \
/petsc/src/binding/petsc4py/demo/legacy/wrap-cython/
H A Dmakefile4 PYTHON=python macro
20 ${MPIEXEC} ${PYTHON} ${SCRIPT}.py
24 ${PYTHON} setup.py -q build_ext --inplace

12345678910