ImpactIn
Python Class for managing IMPACT-Z/T input files. Includes the ability to read and write input files as well as replace string variables found within the file with numeric values.
Installation
The class can be installed from PyPI, using the following command:
pip install impact_input
Read in Input File
Reads in the input file specified by filename. Includes the ability to remove comments (i.e lines beginning with ! or anything occuring after a /) using exclude_comments. By default exclude_comments = True.
from impact_input import ImpactIn
impact_file = ImpactIn(filename="ImpactT_original.in")
Get all Variables
Returns a list of all variables found in the input file. Variable names cannot start with a number.
impact_file.variables()
Replace Variables with Values
Replace the list of variables with the numerical values in the respective order they appear in the list (e.g. gunPhaseF1 becomes 0 below).
replace_var = ["gunPhaseF1","gunPhaseF2"]
val = [0,180]
impact_edit = impact_file.replace(varnames=replace_var,varvals=val)
Write New Input File IMPACT
Write an input file with the specified filename. Note it is best practice to make the new file have a different name than the initial input so as not to overwite it. As the IMPACT-Z/T executables require the input file to be named "ImpactZ.in" or "ImpactT.in", the initial input file should have a name other than those two options.
impact_edit.write(filename='ImpactT.in')
Examples
Examples python scripts that use the ImpactIn class to run a phase scan and find the phase with the maximum energy gain for a RF gun can be found here.
Metadata
Release files for impact-input 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| impact_input-0.0.4.tar.gz | 3.9 kB | Without provenance | Details for impact_input-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| impact_input-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for impact_input-0.0.4-py3-none-any.whl |
Total release size: 8.8 kB
Release files / impact_input-0.0.4.tar.gz
| Download URL | impact_input-0.0.4.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
58cbbe1abd4b1c8cb99781ee1676c770b49694138999fdd355efa36805c9b3e6
|
|
BLAKE2b-256 checksum How to use checksums |
82f2182086ab0c89176197197889f819fbb9c9651010e44b387cfacbebc210eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|
Release files / impact_input-0.0.4-py3-none-any.whl
| Download URL | impact_input-0.0.4-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1dfcb94b67dff91770eb3fa085767088fe2b57d0d38ca2c132097d4bc5f5debf
|
|
BLAKE2b-256 checksum How to use checksums |
c3aaeeb47c8ed0ebde69908ec3887eb5a1c23fbfb67bfe6261bba430647e6ca2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|
Security for impact-input 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.