-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pendf single process #255
base: v1.0
Are you sure you want to change the base?
Pendf single process #255
Conversation
Can you split this PR in 2? Also, as it is It probably won't pass the unit tests. Can you first run them on your computer. |
I removed nuclide2latex function from the PR. |
Replacement of the pendf perturbation procedure. New static method pendf_perturb to apply perturbations sample by sample. |
err=0.01, | ||
temperature=0, | ||
) | ||
njoy_kws = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove these default options.
I think the reconstruction tolerance err
does not need to be the default value of 0.001.
These keywords are only used to produce the ERRORR file right?
Then a low tolerance should be ok.
Also, removing the temperature would just assume by default that the temperature is 0.
Is this the reason why you removed it?
#to transfer keywords to the worker | ||
kwargs["filename"] = filename | ||
kwargs["to_file"] = to_file | ||
kwargs["verbose"] = verbose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include verbose in input in kwargs and then call it using kwargs["verbose"]
sandy/core/endf6.py
Outdated
pendf_pert = self.pendf_perturb(pxs, pendf_) | ||
outs[nxs] = to_ace_worker(self.data, | ||
pendf_pert.data, | ||
nxs, **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to_ace_worker(self.data, pendf_pert.data, nxs, filename=filename, to_file=to_file, **kwargs)?
-------- | ||
|
||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In intro data preprocessing comment saying that kwargs are used for workers and njoy_kws for get_pendf (pendf creation)
sandy/core/endf6.py
Outdated
|
||
if to_ace: | ||
if implicit_effect: | ||
njoy_kws["temperature"] = kwargs["temperature"] = temperature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on this
#Temperature | ||
njoy_kws["temperature"] = temperature | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specific case for xs that requires PENDF generation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be extended (with more if clauses) for other data types
#instances cannot be pickled | ||
|
||
for (nxs,pxs) in seq_xs: | ||
pendf_pert = self.pendf_perturb(pxs, pendf_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to regular method
sandy/core/endf6.py
Outdated
@@ -2175,56 +2175,174 @@ def apply_perturbations(self, smp, processes=1, **kwargs): | |||
else: | |||
return self._mp_apply_perturbations(smp, processes=processes, **kwargs) | |||
|
|||
@staticmethod | |||
def pendf_perturb(pxs, pendf): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
call it perturb_xs
sandy/core/endf6.py
Outdated
if processes == 1: | ||
# Passed ENDF-6 and PENDF as dictionaries because class | ||
#instances cannot be pickled | ||
outs = {nxs: to_ace_worker(self.data, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be deleted
sandy/core/endf6.py
Outdated
# Passed ENDF-6 and PENDF as dictionaries because class | ||
#instances cannot be pickled | ||
outs = {nxs: to_ace_worker(self.data, | ||
self.pendf_perturb(pxs, pendf_).data, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need a function/method to englobe pertrub_xs, perturb_nu, perturb_chi, perturb_mu.
Inputs are endf6 + pendf + perturbed xs, nu, chi, mu
Outputs are pert endf6 and pert pendf.
possibly it returns an iterator
Edit the function for applying perturbation to nuclear data. Pendf files creation as generators in single processing and possibility to create ace files in single or multiprocessing. The task is carried out by new function to_ace_worker that is intended to replace endf6_perturb_worker.