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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: Fix pylint consider-using-enumerate #1221

Merged
merged 1 commit into from Dec 20, 2017
Merged

Conversation

Lestropie
Copy link
Member

Rather than disabling this Pylint warning, instead use more Pythonic approaches where warnings were issued.

Reverts b54c55a committed to dev in #1211.

@jdtournier: I tested the convert_bruker change in interactive Python, but it might be worth running it on data just to be sure.

Also, short aside: I decided recently that when Python variables correspond to option strings to be used in a run.command() call, explicitly naming them as such really helps to separate those variables from other pieces of data flying around. 馃榿

Rather than disabling this Pylint warning, instead use more Pythoninc approaches where warnings were issued.
Reverts b54c55a committed to dev in #1211.
@Lestropie Lestropie self-assigned this Dec 20, 2017
@thijsdhollander
Copy link
Contributor

Yeah, that's fair enough. 馃憤 That was originally not much more than a temporary workaround just to get #1211 done and over with. I did/do wonder though how that suddenly popped up there (in #1211), since it didn't in any other pull requests that had just been merged to dev only days before, whereas e.g. convert_bruker and others where also already looking the way they did in #1211... or I must be overlooking something else somehow.

@Lestropie
Copy link
Member Author

My guess was that TravisCI started pulling newer versions of pylint. But they appear to have not changed. 炉(掳_o)/炉

@thijsdhollander
Copy link
Contributor

My guess was that TravisCI started pulling newer versions of pylint.

Yes, that was the only explanation I could imagine at the time as well. If this would somehow have been the case, or if this can indeed happen in the future as well, we could (eventually) consider enabling a list of pylint checks, rather than disabling a list. I mean, it's in a way a bit weird that our TravisCI checks would change behaviour "all by themselves" over time.

Copy link
Member

@jdtournier jdtournier left a comment

Choose a reason for hiding this comment

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

Didn't know about enumerate... Looks nice and clean, nothing to add.

Won't have the chance to test this on Bruker data any time soon - but then this script has always been provided as a convenience to users, it's still far from perfect (it still don't extract the slice orientation, for instance), I don't think that should hold back a merge.

@Lestropie Lestropie merged commit a259854 into dev Dec 20, 2017
@Lestropie Lestropie deleted the python_enumerate branch December 20, 2017 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants