You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When testing ensdf_processing, the reference output files are mismatched with the generated output files.
I believe the issue is occurring because we have updated our dependencies. We need to consider updating our reference files accordingly. However, I'm not sure how to proceed with this.
Input
importnumpy, os, iofrompyneimportensdf_processing# path to folder for temporary test files.tmp_path="ensdf_processing/tmp"defcreate_tmp():
ifnotos.path.exists(tmp_path):
os.makedirs(tmp_path, exist_ok=True)
deffile_comp(file_out, file_ref, exceptions):
f_out=io.open(file_out, "r", encoding="latin-1")
f_ref=io.open(file_ref, "r", encoding="latin-1")
diff_lines=numpy.array([])
line_num=0forline_outinf_out:
line_ref=f_ref.readline()
print("line_ref: "+line_ref)
print("line_out: "+line_out)
ifline_ref!=line_out:
ignore=Falseforiinrange(0, len(exceptions)):
ifexceptions[i][0] ==1:
ifline_out[0 : len(exceptions[i][1])] ==exceptions[i][1]:
ignore=Trueelifexceptions[i][0] ==2:
ifexceptions[i][1] inline_out:
ignore=Trueelifexceptions[i][0] ==3:
# ignores select lines to allow for tolerable differences# in output precisionifexceptions[i][1] ==line_num:
ignore=Trueelifexceptions[i][0] ==4:
iflen(line_ref[:-1]) ==len(line_out):
# special exception for lines with possible carriage return# instead of standard line feed returnifline_ref[:-2] ==line_out[:-1]:
ignore=Trueifnotignore:
raiseException(
"ENSDF Processing: Incorrect output generated, file: "+file_ref
)
line_num=line_num+1f_out.close()
f_ref.close()
diff_dict= {}
diff_dict["differences_lines"] =diff_linesreturndiff_dictcreate_tmp()
input_dict= {}
input_dict["input_file"] ="ensdf_processing/bldhst/ref_bldhst_iccseq.dat"input_dict["output_table_file"] =tmp_path+"/tmp_bldhst_icctbl.dat"input_dict["output_index_file"] =tmp_path+"/tmp_bldhst_iccndx.dat"output_dict=ensdf_processing.bldhst(input_dict)
ref_table="ensdf_processing/bldhst/ref_icctbl.dat"ref_index="ensdf_processing/bldhst/ref_iccndx.dat"d_table=file_comp(input_dict["output_table_file"], ref_table, [])
d_index=file_comp(input_dict["output_index_file"], ref_index, [])
Output
line_ref: K1pAÝ$=ÍÌ´@ÍCÝFÇ:;î|?>HA@QDK1AÅ 0=\R@TC KFÖ¨;ÙÎ÷=line_out: K1.@øS㥰?@ y@£Û@Ô+eâXg?V-²@K11@j¼t¦?R¸ëQTraceback (most recent call last): File "/mnt/Data/Projects/pyne/tests/test_ensdf_processing.py", line 59, in <module> d_table = file_comp(input_dict["output_table_file"], ref_table, []) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/Data/Projects/pyne/tests/test_ensdf_processing.py", line 41, in file_comp raise Exception(Exception: ENSDF Processing: Incorrect output generated, file: ensdf_processing/bldhst/ref_icctbl.dat
For example, in ensdf_processing.bldhst, the output files (tmp_bldhst_icctbl.dat and tmp_bldhst_iccndx.dat) should match the reference files (ref_icctbl.dat and ref_iccndx.dat) respectively.
Description
When testing
ensdf_processing
, the reference output files are mismatched with the generated output files.I believe the issue is occurring because we have updated our dependencies. We need to consider updating our reference files accordingly. However, I'm not sure how to proceed with this.
Input
Output
pytest log
Expected behavior
For example, in
ensdf_processing.bldhst
, the output files (tmp_bldhst_icctbl.dat
andtmp_bldhst_iccndx.dat
) should match the reference files (ref_icctbl.dat
andref_iccndx.dat
) respectively.Additional information
The text was updated successfully, but these errors were encountered: