Skip to main content

Read, edit, and output parameters for scientific software.

Project description

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 = results

subsection Postprocess
  set Output frequency = 10

  subsection Visuzliation
    set Format = vtu
  end
end

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyrameters-0.0.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyrameters-0.0.1-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file pyrameters-0.0.1.tar.gz.

File metadata

  • Download URL: pyrameters-0.0.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pyrameters-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c43226a01a758d7b1d754c5735c1588eea39af9534e780c743d36852b882b8bc
MD5 262da4911d335c0b0f5bce6fddd8f294
BLAKE2b-256 5c49a52c1493d8aff91f8c9924b2ce515c16aac367d4d9df1e01f3a7842464cb

See more details on using hashes here.

File details

Details for the file pyrameters-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyrameters-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pyrameters-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 feb7702cdc76d7d92d54d39c2045cef103be8f7ba0bee0e5dbd27cadc1667b69
MD5 401ec9a7f1f609cbb74242bd953140a2
BLAKE2b-256 e835081d3a1e919e3cf37441ec3fd092e5bdc815f356786fe95fc1aa5118e38f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page