Git Product home page Git Product logo

pypact's People

Contributors

daantbe avatar deionizedplasma avatar dvp2015 avatar neutronics avatar peboch avatar shimwell avatar thomasms avatar zxkjack123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pypact's Issues

meta stable isotopes mixed in with ppa plot

Hey! I would like to use python to parse the FISPACT output but it seems that meta-stable isotopes are grouped together with non-metastable. (following along the "plotting" example on the main page.

When one plots, for example, Xe-135 then every other data point corresponds to Xe-135m. Which is pretty annoying.

Regards,
Andrew

Digit of fuel entries

An simple fispact-II input was generated via pypact. The material composition are calculated form as set as below:

<< set the target via FUEL >>
FUEL 2
H1 5.974010803153376e+26
H2 6.870902577422786e+22

However, fispact cannot deal with it and here is the error message:

ERROR in INPUT file
 Detected at argument   3 on line  29 of keyword FUEL on line  28.
 Argument value is 5.974010803153376e+26. Expected argument type is floating-point number.
 Abbreviated keyword 5.974010803153376e+26 matches** keywords
 when argument 3 from previous keyword FUEL expected

 ERROR in INPUT file
 Expecting a keyword, but token 5.974010803153376e+26 is too long
 Detected on line number =  29
 Skipping to next keyword

I think the digit of float should be controled when writing input file to avoid running error. For example:

diff --git a/pypact/input/inputdata.py b/pypact/input/inputdata.py
index 16b4991..c3955e0 100644
--- a/pypact/input/inputdata.py
+++ b/pypact/input/inputdata.py
@@ -41,7 +41,10 @@ class FuelInventory(InventoryType):
     def __str__(self):
         strrep = "{} {}".format('FUEL', len(self.entries))
         for i in self.entries:
-            strrep += "\n{} {}".format(i[0], i[1])
+            if len("{}".format(i[1]) > 20:
+                strrep += "\n{} {:.14E}".format(i[0], i[1])
+            else:
+                strrep += "\n{} {}".format(i[0], i[1])

Length of printed floating points exceeds FISPACT input file limits.

The following Irradiation time causes FISPACT to produce the error:

ERROR in INPUT file
Expecting a keyword, but token 1.0318823828959384e+16 is too long
Detected on line number = 120
Skipping to next keyword

This was generated via pypact using the .addIrradiation(1.0, 1.0318823828959384e+16) method. This can be fixed manually (in the FISPACT input file) be reducing the number of decimal places.

Use slots instead of freeze_it decorator

Using slots would reduce memory usage, and possibly improve performance, whilst freezing attributes (as the freeze_it decorator attempts to do).

This may affect the JSON serializable functionality and may need to be changed, since it uses dict.

FNS Fission spectra

Sorry for writting here. But I don't sure my message to your team were delivered through https://fispact.ukaea.uk/contact/ page a couple days ago. I duplicate my message here in common shapes: I with my colleagues from research group working with a code for calculation activation of nuclear material and we use for validation your report "Fusion decay heat validation ..." dated September 2018. Is it possible to get data presented in the work on Fig. 3 FNS Neutron spectra, neutron uence monitored by 27Al(n,�)24Na in a numerical tabulated form?
Be appreciate for any help.

fluxesfile.py: Writing fluxes files using setValue method doesn't set correct groups when small rounding errors present

Hi @thomasms,

I've had a problem when writing fluxes files, when small rounding errors are present the flux is written to the wrong group, with no error handling or warnings.

I've come up with a fix, by adding a rounding tolerance:

setValue(energy_group, flux_value, energy_group_tolerance=0.001

Example showing error:

`import pypact as pp

writing a fluxes file

ff = pp.FluxesFile(name='test', norm=1.0)
ff.setGroup(175)
ff_boundaries = ff.boundaries[::-1]

ff.setValue(1.0000e-05, 1.0)
ff.setValue(1.0000e-01, 2.0)
ff.setValue(4.1400e-01, 3.0)
ff.setValue(5.3200e-01, 4.0)
ff.setValue(6.8300e-01, 5.0)

pp.to_file(ff, 'example.fluxes_file')

print(pp.ALL_GROUPS[175][-5:])`

Will result in a fluxes file with the 3rd 4th and 5th fluxes placed in the groups above, these are then overwritten by other values leaving gaps and incorrect values in the spectrum.

I've made a fix to this on a local branch, but can't push this. Could I be made a developer so that I can push the code to a fix branch?

Regards,

Ross

Reading large output files is slow

For large output files (.out) with large inventories, it is quite slow (>1 sec) to parse such files. I am sure this can be improved using more optimised data structures, and/or rewriting the text finding algorithms.

Alternatively, we could start writing some of this implementation in C++ and bind with pybind to improve performance.

'LinePlotAdapter' object has not attribute 'custom'

Hi,
I think I noted a bug when running the plotnuclideheat.py with ppa.TimeZone.BOTH (irradiation and decay) resulting in an AttributeError: 'LinePlotAdapter' object has not attribute 'custom'. Checking in plotadapter.py in the LinePlotAdapter class there is indeed no attribute 'custom'.
For now, i just comment out the lines and the script works.
Regards, Peter.

input runner not working correctly

Since the Reader was moved to InventoryReader this causes problems with the fispact runner module. This is a simple fix but is important.

Bug: cannot read gamma spectra from new fispact output

Found bug on gamma spectra reading from fispact 4 output.
The bug is reproduced in test, which was added at dvp2015 fork: https://github.com/pypact, branch gamma_spectra_read_bug
See tests/output/test_gamma_spectra_reading.py

The reason is that pypact reading is based on certain number of spaces in output, but the spaces number was changed in our fispact version.

I'm taking on the fix.

I would suggest also to introduce to pypact dependency on numpy to avoid reinventing the wheel. Anyway numpy is just necessary for further analysis modules using pypact. The implementation can also rely on numpy and, probably, xarray. But this is a subject of further issues, not this one. Let's fix the bug first.

Reading values missing "E" character for exponentials

Hello,

I am using FISPACT and noticed that the extract_boundaries_and_values function in gammaspectrum.py for output treatment has issues treating outputs with missing "E" character for exponential format.
gammaspectrum.txt

I added a "patch" from my Python experience wich is not optimal of course.

I hope this is the correct way of contributing. If this is not welcomed, please notify me.
If this is welcomed but clearly not optimal, I'll be happy to know a better method.

Best regards

install fails on v1.3.5 from pypi

Installation fails because the file ".VERSION" is missed in the pypact-1.3.5.tar.gz archive from PyPI.
This prevents using pypact-1.3.5 as dependency from PyPI.

image

Need printlib4 reader

Printlib5 reader exists but we need other print lib support.
Printlib 4 is quite important so let's add this

Bug: Cannot read total mass

Since the text matcher uses 'TOTAL MASS' for both initial and total mass, this causes the total mass to be read as though it is initial mass.

This should be changed to include '0 TOTAL MASS'

JSONSerilizable base class is hacky - needs improvement

For output objects, they extend the JSONSerializable class to allow all data to be (de)serialized to/from JSON easily. However, the code is for deserialization is not well implemented, since extending this for lists of types is difficult. Additionally, the code is slow when trying to parse JSON output data, (really slow compared to other json libraries).

This could be improved and refactored, if anyone is willing to attempt this.

Question about test91 example

Like this pypact package, very helpful for FISPACT users.
I followed the instruction on "README" to try it with the test91.out convert example.
A new test91_new.json was created by the command fispactconverter.py test91.out test91_new.json, but it has different content with the test91.json provided in reference:

drwxr-xr-x  2 gw gw 4.0K 1月  21 10:16 ./
drwxrwxr-x 17 gw gw 4.0K 1月  21 10:08 ../
-rw-r--r--  1 gw gw 103K 1月  21 10:08 test91.json
-rw-r--r--  1 gw gw 152K 1月  21 10:16 test91_new.json
-rw-r--r--  1 gw gw 192K 1月  21 10:08 test91.out

The new generated file test91_new.json has 152K, 4491 lines. But the reference one has 103K, 3009 lines.
Is my installation failed? Or the reference test91.json need to update?

Updates to pypact analysis wiki

pypact.analysis has had attribute names changed, from getallisotopes() to get_all_isotopes(), and findZ() to find_z().

Wiki examples use old method names.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.