Skip to content
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

BUG SensitivityReader storing data from second to last latent generation #365

Closed
drewejohnson opened this issue Dec 3, 2019 · 2 comments
Labels

Comments

@drewejohnson
Copy link
Collaborator

Summary of issue

Sensitivity files for Serpent 2.1.31 include (by default or with additional options) data from intermediate latent generations. The naming of these variables overwrites the "correct" data, e.g. data for sensitivity of keff is taken from the second to last latent generation rather than all latent generations. This issue was reported on the discussion forum

Code for reproducing the issue

New KEFF_SENS data are provided as

59:ADJ_PERT_KEFF_SENS = [
63:ADJ_PERT_KEFF_SENS = reshape(ADJ_PERT_KEFF_SENS, [2, SENS_N_ENE, SENS_N_PERT, SENS_N_ZAI, SENS_N_MAT]);
64:ADJ_PERT_KEFF_SENS = permute(ADJ_PERT_KEFF_SENS, [5, 4, 3, 2, 1]);
66:ADJ_PERT_KEFF_SENS_E_INT = [
70:ADJ_PERT_KEFF_SENS_E_INT = reshape(ADJ_PERT_KEFF_SENS_E_INT, [2, SENS_N_PERT, SENS_N_ZAI, SENS_N_MAT]);
71:ADJ_PERT_KEFF_SENS_E_INT = permute(ADJ_PERT_KEFF_SENS_E_INT, [4, 3, 2, 1]);
282:ADJ_PERT_KEFF_SENS_0_GEN = [
286:ADJ_PERT_KEFF_SENS_0_GEN = reshape(ADJ_PERT_KEFF_SENS_0_GEN, [2, SENS_N_ENE, SENS_N_PERT, SENS_N_ZAI, SENS_N_MAT]);
287:ADJ_PERT_KEFF_SENS_0_GEN = permute(ADJ_PERT_KEFF_SENS_0_GEN, [5, 4, 3, 2, 1]);
289:ADJ_PERT_KEFF_SENS_0_GEN_E_INT = [
293:ADJ_PERT_KEFF_SENS_0_GEN_E_INT = reshape(ADJ_PERT_KEFF_SENS_0_GEN_E_INT, [2, SENS_N_PERT, SENS_N_ZAI, SENS_N_MAT]);
294:ADJ_PERT_KEFF_SENS_0_GEN_E_INT = permute(ADJ_PERT_KEFF_SENS_0_GEN_E_INT, [4, 3, 2, 1]);
493:ADJ_PERT_KEFF_SENS_1_GEN = [
497:ADJ_PERT_KEFF_SENS_1_GEN = reshape(ADJ_PERT_KEFF_SENS_1_GEN, [2, SENS_N_ENE, SENS_N_PERT, SENS_N_ZAI, SENS_N_MAT]);
...
2181:ADJ_PERT_KEFF_SENS_9_GEN = [
2185:ADJ_PERT_KEFF_SENS_9_GEN = reshape(ADJ_PERT_KEFF_SENS_9_GEN, [2, SENS_N_ENE, SENS_N_PERT, SENS_N_ZAI, SENS_N_MAT]);
2186:ADJ_PERT_KEFF_SENS_9_GEN = permute(ADJ_PERT_KEFF_SENS_9_GEN, [5, 4, 3, 2, 1]);
2188:ADJ_PERT_KEFF_SENS_9_GEN_E_INT = [
2192:ADJ_PERT_KEFF_SENS_9_GEN_E_INT = reshape(ADJ_PERT_KEFF_SENS_9_GEN_E_INT, [2, SENS_N_PERT, SENS_N_ZAI, SENS_N_MAT]);
2193:ADJ_PERT_KEFF_SENS_9_GEN_E_INT = permute(ADJ_PERT_KEFF_SENS_9_GEN_E_INT, [4, 3, 2, 1]);

Actual outcome including console output and error traceback if applicable

The method for processing these arrays

if line[:3] == 'ADJ':
fullVarName = line.split()[0]
split = fullVarName.split('_')
pertIndx = split.index('PERT')
sensIndx = split.index('SENS')
varName = '_'.join(split[pertIndx + 1: sensIndx])

doesn't contain logic for these N_GEN names, and then overwrites the useful information, e.g. data from ADJ_PERT_KEFF_SENS_9_GEN is stored in place of ADJ_PERT_KEFF_SENS as sensitivities["keff"]

Expected outcome

Store data from all latent generations, ADJ_PERT_KEFF_SENS as the actual data, with options to store data from latent generations as well.

Versions

Please provide the following:
Per the reporting user

  • Version from serpentTools.__version__ 0.9.0
  • Python version - python --version N/A
  • IPython or Jupyter version if applicable N/A
  • If using the development version, the output from git describe
@drewejohnson drewejohnson changed the title BUG BUG SensitivityReader storing data from second to last latent generation Dec 4, 2019
drewejohnson added a commit to drewejohnson/serpent-tools that referenced this issue Dec 8, 2019
Related to GH issue CORE-GATECH-GROUP#365, where the use of the new Serpent
sens opt history 1 option prints out additional sensitivity
data. In this mode, sensitivities using 1<=n<N latent generations
are printed, where N is the number specified using sens opt latgen
argument. This creates new arrays of the form

ADJ_PERT_SENS_<RESP>_<N>_GEN
ADJ_PERT_SENS_<RESP>_<N>_GEN_E_INT

to the sensitivity files.  As reported in the issue,
serpentTools would store the last set of <N>_GEN as the actual
response, so the value stored would reflect data using one fewer
latent generations.

The sensitivity test file is modified to include four new arrays,

ADJ_PERT_keff_SENS_1_GEN
ADJ_PERT_keff_SENS_1_GEN_E_INT
ADJ_PERT_fis2flx_SENS_1_GEN
ADJ_PERT_fis2flx_SENS_1_GEN_E_INT

These arrays are identical the non _1_GEN values, except the
very first value and associated uncertainty are set to zero.
Running the sensitivity file test will fail due to this
change, as the reference data have not been changed in the file,
but are overwritten as reported in the issue.
@drewejohnson
Copy link
Collaborator Author

Merged into master with #366 and will be a part of 0.9.1 release

@drewejohnson
Copy link
Collaborator Author

Merged into develop with #369

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant