Skip to content

Fix CifData and tcod exporters for python3#2092

Merged
giovannipizzi merged 61 commits into
aiidateam:developfrom
ltalirz:cif_fixes
Oct 25, 2018
Merged

Fix CifData and tcod exporters for python3#2092
giovannipizzi merged 61 commits into
aiidateam:developfrom
ltalirz:cif_fixes

Conversation

@ltalirz
Copy link
Copy Markdown
Member

@ltalirz ltalirz commented Oct 23, 2018

  • select working version of PyCifRW in setup_requirements.py for python2 and python3

select working version of PycCifRW for python2 and python3
@ltalirz ltalirz requested a review from waychal October 23, 2018 09:09
@coveralls
Copy link
Copy Markdown

coveralls commented Oct 23, 2018

Coverage Status

Coverage increased (+0.3%) to 68.64% when pulling d496abf on ltalirz:cif_fixes into a9400ea on aiidateam:develop.

ltalirz and others added 6 commits October 23, 2018 11:56
_exportstring should return bytes.
to reflect this, we are renaming it and updating its docstring
errors were only converted to test failures
(the interactive part of the test is failing now)
still to do: fix base64 conversion
@ltalirz ltalirz changed the title select working pycifrw in setup requirements [WIP] Fix CifData and tcod exporters for python3 Oct 23, 2018
@ltalirz ltalirz removed the request for review from waychal October 23, 2018 15:58
 + yapf fix
merkys and others added 8 commits October 24, 2018 14:55
…erministic output in TcodExporter. Enabling one more Python 3 test case.
… expressions to avert problems caused by numeric precision.
encode_textfield_ncr and decode_textfield_ncr are not working properly
yet, needs more investigation.

skip test_contents_encoding_2 test for the moment
@merkys merkys changed the title [WIP] Fix CifData and tcod exporters for python3 Fix CifData and tcod exporters for python3 Oct 24, 2018
@merkys
Copy link
Copy Markdown
Member

merkys commented Oct 24, 2018

Work finished. @giovannipizzi you may review the code now.

Comment thread aiida/backends/tests/dbimporters.py Outdated
Comment thread aiida/tools/dbexporters/tcod.py Outdated
h = "0{}".format(h)
return "{}={}{}".format(prefix, h, postfix)
h = "0%s" % h
return b"%s=%s%s" % (prefix, h.encode('utf-8'), postfix)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to use % instead of .format()? In all the rest of the code we use .format()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Also for this, same question in many points)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yakutovicha, have you changed these lines? I am actually not aware of the differences between % and format.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently the .format() is not able to return bytes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Also for this, same question in many points)

This seems to be the last occurrence now, I have replaced others.

Comment thread aiida/backends/tests/tcodexporter.py
Comment thread aiida/tools/dbexporters/tcod.py Outdated
Copy link
Copy Markdown
Member

@giovannipizzi giovannipizzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a final change, the rest is fine!

Comment thread aiida/tools/dbexporters/tcod.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants