Skip to content

Conversation

@ax3l
Copy link
Member

@ax3l ax3l commented Dec 16, 2021

Preparation for #2385: Generalize a list of test scripts so that we have an easier time finishing that long-standing PR with less conflicts to track.

Also avoids that we add more scripts with the old/hard-coded patterns.

@ax3l ax3l added the component: tests Tests and CI label Dec 16, 2021
@ax3l ax3l requested review from EZoni and RemiLehe December 16, 2021 18:08
@ax3l ax3l force-pushed the topic-fileMinPrefix6Prep branch from 7a00d75 to f1c808a Compare December 16, 2021 18:10
@ax3l ax3l added the component: diagnostics all types of outputs label Dec 16, 2021
@ax3l ax3l changed the title Generalize Analysis Scripts: Number of Digits Generalize Analysis Scripts: Number of Digits (plt) Dec 16, 2021
Thanks Phil! :)

Co-authored-by: Phil Miller <[email protected]>
import sys
import yt
import numpy as np
import os
Copy link
Member

Choose a reason for hiding this comment

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

To be PEP8 compliant, the import os should be before the imports of numpy and yt.

Copy link
Member Author

@ax3l ax3l Dec 16, 2021

Choose a reason for hiding this comment

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

Interesting PEP8 style choice, because contrary to C/C++ includes, this has no real influence ^^
(besides global behavior, like where mpi4py is placed).
https://www.python.org/dev/peps/pep-0008/#imports

I think we need a bot for this, maybe we can add this to .pre-commit-config.yaml.

I would not change it in the current PR, since already existing sys imports are mostly off. Let's do style fixes to existing code in separate style-only/cleanup PRs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Clarified on Slack: separate, we are looking for tools that can do it :)

Maybe autopep8 or flake8.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried autopep8 --select E401,E402 --in-place --aggressive --aggressive <filename> and all it does is sort alphabetically.

Copy link
Member Author

Choose a reason for hiding this comment

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

The tool isort does the trick: #2686
https://github.com/PyCQA/isort

Copy link
Member

@EZoni EZoni left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for splitting #2385 in smaller tasks.

@ax3l ax3l merged commit a194b90 into BLAST-WarpX:development Dec 17, 2021
@ax3l ax3l deleted the topic-fileMinPrefix6Prep branch December 17, 2021 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: diagnostics all types of outputs component: tests Tests and CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants