Pyrameters
Pyrameters is a package for programmatically interacting with hierarchical parameter inputs for scientific software. It is currently targeted at the Deal.II PRM format.
Usage
This package can be installed from the PyPi package manager
pip install pyrameters
Using it is a matter of importing the pyrameters module, and creating a PRM object.
from pyrameters import PRM
with open('input.prm','r') as input:
prm = PRM(input.read())
if prm['Dimension'] == 2:
prm.set('/Model geometry/Hypercube/Length', 100)
else:
prm.get('/Model geometry/Hypercube/Length', 10)
print(prm)
An empty PRM object can also be created without providing an input file.
from pyrameters import PRM
prm = PRM()
prm['Dimension'] = 3
prm['Output directory'] = 'results'
prm.add_subsection('Postprocess')
prm['Postprocess']['Output frequency'] = 10
prm.set('/Postprocess/Visualization/Format','vtu')
print(prm)
Which would output parameters to the terminal in valid PRM format:
set Dimension = 3
set Output directory = resultssubsection Postprocess
set Output frequency = 10subsection Visuzliation
set Format = vtu
end
end
Release files for pyrameters 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyrameters-0.0.1.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyrameters-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.7 kB
Release files / pyrameters-0.0.1.tar.gz
| Download URL | pyrameters-0.0.1.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c43226a01a758d7b1d754c5735c1588eea39af9534e780c743d36852b882b8bc
|
|
BLAKE2b-256 checksum How to use checksums |
5c49a52c1493d8aff91f8c9924b2ce515c16aac367d4d9df1e01f3a7842464cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
|
Release files / pyrameters-0.0.1-py3-none-any.whl
| Download URL | pyrameters-0.0.1-py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
feb7702cdc76d7d92d54d39c2045cef103be8f7ba0bee0e5dbd27cadc1667b69
|
|
BLAKE2b-256 checksum How to use checksums |
e835081d3a1e919e3cf37441ec3fd092e5bdc815f356786fe95fc1aa5118e38f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
|