pysss2
Python tools to interact with Serpent 2 Monte Carlo code
Pysss2 C-side code is expected to be released with Serpent 2.1.32. Until then, the Serpent 2 development version is needed.
The key resource provided by this package is the GUI to inspect Serpent 2 geometries interactively. The program allows interactive plotting of various cross sections: xy, xz or yz slices. The plot limits and the number of pixels can be chosen and the resulting figures can be saved. Also the material, cell and universe of a point can be checked.
Usage (buttons on the right)
- Gray buttons change the view limits on the bar on top
- Geom. Limits resets the default limts
- View to limits moves the current zoomed in/out limits to the top bar
- Green buttons updates the plots in addition to changing the values
- View to limits & Upd is just updating version of the gray button
- V2L & P1:1 & Upd does the same as above, but also tries to set the number of pixels to match the number of pixels on the displaying screen
- V2L & P1:10 & Upd does the same as above, but only has one calculated pixel for each 10x10 screen pixels
- Yellow buttons change the slice (XY, XZ or YZ) to view:
- to ?? & Upd After clicking a yellow button, click on the plot to choose the location for the new slice
- The blue button:
- eval pos Evaluates the material, cell and universe in the point clicked with mouse. The results are shown in the status bar and printed in the terminal.
- The red buttons:
- Reload Restarts the plotter, forcing Serpent to regenerate the geometry (e.g. after the input has been changed).
- Quit Exits the program.
When the python program launches, it launches serpent as a library using ctypes. The python side of the code only accepts a single optional first parameter: "--libsss2so /path/to/libsss2.so". All the rest are passed on to serpent un-parsed. In other words, the other parameters are serpent's parameters, not for the python.
How to install and run the GUI:
-
Install pysss2 with pip, as explained in the pypi page of the project.
- The code uses python 3. It is known to work at least with version 3.6.7. You can check the current with e.g. "python3 -c "import sys; print(sys.version)".
- There was a bug in matplotlib, so 'matplotlib>=3.1.1' is needed. You can check the current version with e.g. "python3 -c "import matplotlib; print(matplotlib.version)"
-
Compile the "lib" target (possibly in a dedicated folder) with the -fpic setting enabled in Makefile. (That is, uncomment the line "CFLAGS += -fpic". Then run "make clean" and then "make lib". The result should be a shared library called libssss2.so. This file includes all the routines of serpent, but they can be called from other programs.
-
In your serpent input file you need to define colors for all materials (e.g. "rgb 10 20 30").
-
When running pysss2, the python code must know where to find the libssss2.so shared library. Thus, you need to either add the folder of libsss2.so in LD_LIBRARY_PATH environment or specify the absolute path to the file as the first two parameters: "pysss2 --libsss2so /absolute/path/to/libsss2.so ...". Rest of the parameters are passed to serpent. Here is a full example: "pysss2 --libsss2so /absolute/path/to/libsss2.so model -omp 4".
Metadata
Release files for pysss2 0.4.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 | Provenance | Actions |
|---|---|---|---|---|
| pysss2-0.4.1.tar.gz | 19.7 kB | Without provenance | Details for pysss2-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pysss2-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for pysss2-0.4.1-py3-none-any.whl |
Total release size: 54.3 kB
Release files / pysss2-0.4.1.tar.gz
| Download URL | pysss2-0.4.1.tar.gz |
|---|---|
| Size | 19.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
58c296eaf00e0cb8b24b4b67fc36ffdc157a40522542eb3df3a5d8836812e84e
|
|
BLAKE2b-256 checksum How to use checksums |
09ec4a1ea5efc6fea09db5ce6d3a04a1053a840b75ebe100e2aa0c9c63e064f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0.post20200119 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.7
|
Release files / pysss2-0.4.1-py3-none-any.whl
| Download URL | pysss2-0.4.1-py3-none-any.whl |
|---|---|
| Size | 34.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23947e2de792033f1bfae4e3dcf5509895d5437ba96bd2b24a8da8a82fdee59f
|
|
BLAKE2b-256 checksum How to use checksums |
66af6f1964518f23f70cada5b69561fa976fe23c945b386023ae6227d051833e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0.post20200119 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.7
|
Security for pysss2 0.4.1
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.