pysrim-docker
Docker executor for PySRIM
Getting Started
To use this package, simply remove calls to run() method of SR and TRIM, and replace them with a call to the executor run dispatch method, e.g.:
from srim.executor import DockerExecutor
from srim import TRIM
executor = DockerExecutor()
trim = TRIM(...)
result = executor.run(trim)
Out of the box, the DockerExecutor uses the costrouc/srim Docker image, and writes the input and output files to a temporary directory.
Example
from srim.executor import DockerExecutor
from srim import Ion, Layer, Target, TRIM
from matplotlib import pyplot as plt
# Construct a 3MeV Nickel ion
ion = Ion('Ni', energy=3.0e6)
# Construct a layer of nick 20um thick with a displacement energy of 30 eV
layer = Layer({
'Ni': {
'stoich': 1.0,
'E_d': 30.0,
'lattice': 0.0,
'surface': 3.0
}}, density=8.9, width=20000.0)
# Construct a target of a single layer of Nickel
target = Target([layer])
# Initialize a TRIM calculation with given target and ion for 25 ions, quick calculation
trim = TRIM(target, ion, number_ions=25, calculation=1)
# Create executor and run TRIM
executor = DockerExecutor()
result = executor.run(trim)
# Pull out ionization
ioniz = result.ioniz
# Plot results
_, ax = plt.subplots()
ax.plot(ioniz.depth, ioniz.ions, label='Ionization from Ions')
ax.plot(ioniz.depth, ioniz.recoils, label='Ionization from Recoils')
plt.show()
Why?
There are a number of different ways that SRIM can be invoked to run simulations. Unix-like OS users have the option of using wine with or without xvfb.
Windows users can directly call the binaries. Docker users can choose to defer to a pre-built SRIM container.
By abstracting the executor from the SRIM input file generation, executors can easily be swapped in and out, or extended as necessary.
Metadata
Release files for pysrim-executor 0.1.0
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 | |
|---|---|---|---|---|
| pysrim-executor-0.1.0.tar.gz | 5.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pysrim_executor-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.4 kB
Release files / pysrim-executor-0.1.0.tar.gz
| Download URL | pysrim-executor-0.1.0.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0578bea71d3444313706f8ad23e6ae0830b79931c323d84017112dbcc25c1997
|
|
BLAKE2b-256 checksum How to use checksums |
014715e6af6f01d7fbfb3d4ff77a039db506b9546501df17dac6744959a568ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.8.5 Linux/5.8.0-44-generic
|
Release files / pysrim_executor-0.1.0-py3-none-any.whl
| Download URL | pysrim_executor-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b6b17913c45b1447c60301acbe8ac76fb7a31a8c4e80c1d2c357695bd30cb11
|
|
BLAKE2b-256 checksum How to use checksums |
e4b09193d61e3824778a5f58ac31f165df8de0a382bac38cff5c98ec8ce2687e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.8.5 Linux/5.8.0-44-generic
|
Security for pysrim-executor 0.1.0
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.