.inp File to Python Kwarg Mapping¶
This page provides a complete mapping between the .inp configuration file
keywords and the corresponding Python keyword arguments. Use this as a
reference when migrating from .inp-based workflows to the Python API.
Species Identification¶
|
Python Kwarg |
Example ( |
Example (Python) |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
File Paths¶
|
Python Kwarg |
Example ( |
Example (Python) |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Function Toggles¶
|
Python API Function |
|
Python Usage |
|---|---|---|---|
|
|
|
Call function directly |
|
|
|
Call function directly |
|
|
|
Call function directly |
|
|
|
Call function directly |
|
|
|
Call function directly |
|
|
|
Call function directly |
|
|
|
Call function directly |
|
|
|
Call function directly |
|
|
|
Call function directly |
:::{note}
In the Python API, you don’t need to set these toggle flags. Simply calling
a function (e.g. px.cross_sections(...)) automatically enables that
function. The toggle is only relevant in .inp files or when using
px.run().
:::
Computing Resources¶
|
Python Kwarg |
|
Python Type |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CPU / GPU Example Mapping¶
.inp
RunMode CPU
GPUBackend AUTO
GPUBatchLines
GPUBatchGrid
RunMode GPU
GPUBackend AUTO
GPUBatchLines 8192
GPUBatchGrid 256
RunMode GPU
GPUBackend CUDA
GPUBatchLines 8192
GPUBatchGrid 256
RunMode GPU
GPUBackend MPS
GPUBatchLines 8192
GPUBatchGrid 256
Python API
px.cross_sections(
...,
run_mode='CPU',
)
px.cross_sections(
...,
run_mode='GPU',
gpu_backend='AUTO',
gpu_batch_lines=8192,
gpu_batch_grid=256,
)
px.cross_sections(..., run_mode='GPU', gpu_backend='CUDA')
px.cross_sections(..., run_mode='GPU', gpu_backend='PyTorch-CUDA')
px.cross_sections(..., run_mode='GPU', gpu_backend='CuPy-CUDA')
px.cross_sections(..., run_mode='GPU', gpu_backend='MPS')
Notes:
Omit these kwargs to use default CPU mode (
run_mode='CPU').Use
gpu_backend='AUTO'unless you explicitly want a fixed backend.Backend fallback order for
AUTO:PyTorch-CUDA -> CuPy-CUDA -> MPS -> CPU.Backend fallback order for
CUDA:PyTorch-CUDA -> CuPy-CUDA -> MPS -> CPU.GPU acceleration applies to
cooling_functions,stick_spectra,cross_sections, andstick_spectra_cross_section.
Quantum Numbers¶
|
Python Kwarg |
|
Python Type |
|---|---|---|---|
|
|
|
|
|
|
|
|
Conversion¶
|
Python Kwarg |
|
Python Type |
|---|---|---|---|
|
|
|
|
|
|
|
Two separate |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Partition Functions / Specific Heats / Cooling Functions¶
|
Python Kwarg |
|
Python Type |
|---|---|---|---|
|
|
|
|
|
|
|
|
Lifetimes¶
|
Python Kwarg |
|
Python Type |
|---|---|---|---|
|
|
|
|
Oscillator Strengths¶
|
Python Kwarg |
|
Python Type |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Stick Spectra¶
|
Python Kwarg |
|
Python Type |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Two separate |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Cross Sections¶
All stick spectra parameters above, plus:
|
Python Kwarg |
|
Python Type |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Non-LTE¶
|
Python Kwarg |
|
Python Type |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(NLTEMethod D/P path) |
|
|
|
Key Differences Between .inp and Python API¶
Feature |
|
Python API |
|---|---|---|
Enable function |
Set flag to |
Call function directly |
Boolean values |
|
|
Disable filter |
|
|
Lists |
Space-separated |
Python |
Multiple temperatures |
One per line |
Single |
Multiple pressures |
One per line |
Single |
Range |
Single line |
Two args: |
Plot toggle |
Function-specific name |
Generic |
Unit spec |
Combined |
Separate |
Example Side-by-Side¶
.inp file:
Database ExoMol
Molecule MgH
Isotopologue 24Mg-1H
Dataset XAB
SpeciesID 501
CrossSections 1
Temperatures 1000:4000:1000
Pressures 0.1,1.0
Range 0 30000
Profile SciPyVoigt
Python API equivalent:
px.cross_sections(
database='ExoMol',
molecule='MgH',
isotopologue='24Mg-1H',
dataset='XAB',
species_id=501,
temperatures=[1000, 2000, 3000, 4000],
pressures=[0.1, 1.0],
min_range=0,
max_range=30000,
profile='SciPyVoigt',
)