Comments (4)
Hi Tom, the values attribute works fine.
Thanks,
Ross
from pypact.
Congratulations for submitting your first issue on pypact. Thanks for contributing!
from pypact.
We could add a tolerance, but I think that would defeat the purpose of that API. The setValue
is intended as a convenience method for simple fluxes i.e setting a monoenergetic flux as:
# will make a 14 MeV beam in 3 lines for 175 group
ff = pp.FluxesFile()
ff.setGroup(175)
ff.setValue(14.0e6, 1.0)
# to file
pp.to_file(ff, "fluxes")
or the other use case of setValue
is to permute one or two bin values after setting a base spectrum i.e. doing total MC.
ff = pp.FluxesFile()
ff.setGroup(175)
ff.values = [.....]
# change the 14 MeV bin to 0.8
ff.setValue(14.0e6, 0.8)
# to file
pp.to_file(ff, "fluxes")
If you simply just want to set a complete spectrum (all the bins) just use the values attribute.
For example:
# an array of 175 values set or retrieved from somewhere else.
myvalues = [......]
ff = pp.FluxesFile()
ff.setGroup(175)
# values are not protected - can read & write
ff.values = myvalues
# to file
pp.to_file(ff, "fluxes")
Does this help with your use case?
from pypact.
But if you still want to add the tolerance, then please make a pull request :)
from pypact.
Related Issues (20)
- Apply missing doc strings HOT 1
- Add ability to read DPA HOT 1
- Allow reading of printlib files - printlib5
- Updates to pypact analysis wiki HOT 4
- Bug: cannot read gamma spectra from new fispact output HOT 1
- Bug: Cannot read total mass
- input runner not working correctly
- Need printlib4 reader
- FNS Fission spectra HOT 2
- Question about test91 example HOT 3
- Digit of fuel entries HOT 1
- Length of printed floating points exceeds FISPACT input file limits. HOT 3
- Add python 3.9 to CI HOT 1
- Add convenience properties to Nuclide HOT 5
- install fails on v1.3.5 from pypi HOT 1
- meta stable isotopes mixed in with ppa plot HOT 6
- 'LinePlotAdapter' object has not attribute 'custom' HOT 3
- Check python 3.10+ support
- Reading values missing "E" character for exponentials HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pypact.