msg-byu / enumlib

Derivative structure enumeration library
MIT License
59 stars 34 forks source link

Good/bad news #4

Closed wsmorgan closed 8 years ago

wsmorgan commented 9 years ago

I've got the unit tests for the gen_multilattice_derivatives working in the github version of enumlib, the svn one hasn't ever worked before for various issues. That is the good news, here is the bad news:

RESULT: derivative_structure_generator.gen_multilattice_derivatives | original 
    28.29% success (28.51% common) in 4288.2800 ms

The reason it's failing is because the old and current outputs list the structures in a different order, ie this structure from the old format is the 2nd one in the list:

start   #tot      HNF     Hdegn   labdegn   Totdegn   #size idx    pg    SNF             HNF                 Left transform                          labeling

          2         2       2       16       32           2   8     8   1  1  8    1  0  1  0  1  8      1    0    0    0    1    0    0   -1    1   00000001

It's match is the 15th in the new format:

start   #tot     #size nAt  pg    SNF             HNF                 Left transform                 labeling

         15        15   8    4   1  1  8    1  0  1  0  1  8      1   0   0   0   1   0   0  -1   1  00000001

Any thoughts on what we want to do about this or how to handle it better?

rosenbrockc commented 9 years ago

Wiley, you need to specify a compound key in the template. The key attribute of the body tag can have a comma-separated list of names from the line template.

We just need to know what combination of columns forms a unique key for each enumerated structure. On Jun 9, 2015 10:37 AM, "Wiley Morgan" notifications@github.com wrote:

I've got the unit tests for the gen_multilattice_derivatives working in the github version of enumlib, the svn one hasn't ever worked before for various issues. That is the good news, here is the bad news:

RESULT: derivative_structure_generator.gen_multilattice_derivatives | original 28.29% success (28.51% common) in 4288.2800 ms

The reason it's failing is because the old and current outputs list the structures in a different order, ie this structure from the old format is the 2nd one in the list:

start #tot HNF Hdegn labdegn Totdegn #size idx pg SNF HNF Left transform labeling

      2         2       2       16       32           2   8     8   1  1  8    1  0  1  0  1  8      1    0    0    0    1    0    0   -1    1   00000001

It's match is the 15th in the new format:

start #tot #size nAt pg SNF HNF Left transform labeling

     15        15   8    4   1  1  8    1  0  1  0  1  8      1   0   0   0   1   0   0  -1   1  00000001

Any thoughts on what we want to do about this or how to handle it better?

— Reply to this email directly or view it on GitHub https://github.com/msg-byu/enumlib/issues/4.

wsmorgan commented 9 years ago

So I think I implemented this correctly but I either get no change or else there is on odd bug that poops up. Here is the body of the xml:

  <body stop="EOF" key="strucutre.natoms, structure.SNF*3, structure.HNF*6,
            structure.left_transforms*9, structure.labeling" versions="1,2,3">
    <line id="structure" type="int" values="23" versions="1,2"
      names="numtot, size, natoms, pg, SNF*3, HNF*6, 
         left_transform*9, labeling" />
    <line id="structure" type="int" values="27" versions="3"
      names="numtot, numHNF, Hdegn, labdegn, Totdegn, size, natoms, 
         pg, SNF*3, HNF*6, left_transform*9, labeling" />
  </body>

If I run this it tells me that:

  File "/Users/wileymorgan/.virtualenvs/fortpy/lib/python2.7/site-packages/fortpy/testing/comparer.py", line 422, in _get_key_value_list
    values = [_get_key_value_single(k, bodyblock) for k in template.key]
  File "/Users/wileymorgan/.virtualenvs/fortpy/lib/python2.7/site-packages/fortpy/testing/comparer.py", line 455, in _get_key_value_single
    msg.err("block {} did not return a valid key value for '{}'.".format(bodyblock, template.key))
NameError: global name 'template' is not defined

Without the three in the version tag then it returns the 28.29%, but I think it needs to have the 3 there because the most recent struct_enum.out is version 3.

rosenbrockc commented 9 years ago

You misprinted structures for natoms. For the other two, you shouldn't include the *n after the name.

I never deny the possibility of a bug, but that would be the first thing to try. I seem to remember that we already fixed a bug related to the template exception you posted, but the fix is only in the next revision, which I haven't committed yet. On Jun 9, 2015 2:09 PM, "Wiley Morgan" notifications@github.com wrote:

So I think I implemented this correctly but I either get no change or else there is on odd bug that poops up. Here is the body of the xml:

<line id="structure" type="int" values="23" versions="1,2" names="numtot, size, natoms, pg, SNF3, HNF6, left_transform9, labeling" /> <line id="structure" type="int" values="27" versions="3" names="numtot, numHNF, Hdegn, labdegn, Totdegn, size, natoms, pg, SNF3, HNF6, left_transform9, labeling" />

If I run this it tells me that:

File "/Users/wileymorgan/.virtualenvs/fortpy/lib/python2.7/site-packages/fortpy/testing/comparer.py", line 422, in _get_key_value_list values = [_get_key_value_single(k, bodyblock) for k in template.key] File "/Users/wileymorgan/.virtualenvs/fortpy/lib/python2.7/site-packages/fortpy/testing/comparer.py", line 455, in _get_key_value_single msg.err("block {} did not return a valid key value for '{}'.".format(bodyblock, template.key)) NameError: global name 'template' is not defined

Without the three in the version tag then it returns the 28.29%, but I think it needs to have the 3 there because the most recent struct_enum.out is version 3.

— Reply to this email directly or view it on GitHub https://github.com/msg-byu/enumlib/issues/4#issuecomment-110489168.

wsmorgan commented 9 years ago

I've fixed the typos but the error: NameError: global name 'template' is not defined persists. I'll try again after the update to fortpy though

wsmorgan commented 8 years ago

Fixed and global unit tests are in progress. I'll note here that due to a change in the order in which the labels are generated it isn't possible to automate the unit tests between version 1 of the code and later versions.