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

Python 3 conversion #27

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Python 3 conversion #27

wants to merge 5 commits into from

Conversation

jboes
Copy link
Contributor

@jboes jboes commented Jul 3, 2018

Significant changes for Python3 compatibility:

  • All popen(2) converted to subprocess commands
  • All os.systems converted to subprocess commands
  • Extensive unicode format handling
  • Mode and opt_algorithm deprecated in favor of calculation and ion_dynamics (QE & ASE convention)
  • Print statements made to print functions
  • See comments below for additional changes

aggressive autopep8 and yapf formatting changes for readability.

Copy link
Contributor Author

@jboes jboes left a comment

Choose a reason for hiding this comment

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

Relaxation was tested along with the get_pdos function and the extract_total_potential function.


if self.convergence is None:
self.conv_thr = 1e-6/rydberg
self.conv_thr = 1e-6 / Rydberg
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Constraints removed in favor of ASE values (the same to 5th decimal place)

J = Jlist[i],
U_alpha = U_alphalist[i])

self.specdict[s] = utils.SpecObject(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Camel Case for SpecObject python class naming convention.


def read_2d_grid(self, stream, log):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This function isn't called at all. I removed it, but can add it back if necessary.

x = stream.readline()
data = []
ntotal = np.prod(n)
while len(data) < ntotal:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change from np.fromfile to loop which accomplishes the same effect. The bytes stdout from the subprocess command was not being handled correctly.

@lmmentel
Copy link

lmmentel commented Jul 3, 2018

FYI @jboes https://github.com/lmmentel/ase-espresso

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.

2 participants