-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Solving crop_by_coord problem when data are rotated #113
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
909ce8c
Solving crop_by_coord problem when data are rotated
BaptistePellorceAstro 28aba8c
New error raising and dimension modified
BaptistePellorceAstro 952a712
Adding a new test for rotated data
BaptistePellorceAstro cefd9a7
PEP8 correction in test_ndcube.py
BaptistePellorceAstro 5a0f454
Solving test bug with old values on crop by coords
BaptistePellorceAstro b837d0e
Some error tests added
BaptistePellorceAstro 77b32f7
New API for crop by coords with units
BaptistePellorceAstro 16c08f0
Some Quantity types checks refactored
BaptistePellorceAstro 1adde1d
Fix a test error
BaptistePellorceAstro 76501e1
Improving units checks in crop by coords
BaptistePellorceAstro 7c56239
Improving corners calculation
BaptistePellorceAstro 4f729dd
Improving the data slicing
BaptistePellorceAstro b097241
Fix some error bugs
BaptistePellorceAstro d6cf940
Removing product importation
BaptistePellorceAstro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity, why are you breaking up this line and others like it into two? According to the PEP8 standard, lines of code can be up to 99 characters long. It doesn't affect the functionality. It's just a coding style question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am coding on Atom and I have a line at 70 characters that I have to avoid to exceed.
Then I am coding with three windows on my screen so I only can see around 75 characters. This is better for me. If you want, I can modify it but I think that for user with a lot of code windows, it is hard to see everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's general to stick with the PEP8 standard and have lines up to 99 characters. The 70 line limit and size of your screen is specific to you and wont make it the code more readable for others. Not every line has to be 99 characters of course. Split lines where it makes sense. But if one line is less than 99 characters, don't split it over two. As I said, it's more readable and keeps the style standardised with the majority of other Python code out there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will change that ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP8 says "Limit all lines to a maximum of 79 characters." This is a matter of preference, but I think it is a bad idea to go over 80. If the python standard library can make it under 80 characters, I don't see why we shouldn't be able to. The vertical line in Atom should default to 80.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The general policy in SunPy core is 99 since they added this to PEP8:
I leave the decision up to @DanRyanIrish though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's stick with the SunPy core policy of 99 character-long lines. I believe the 80 character limit comes from the days when computers were operated with punch cards! Nowadays most people have big and/or multiple screens so viewing 99 characters isn't a problem. It also encourages (or doesn't inhibit) the use of longer, more explicit variable names which is a good thing. I find that this and reducing cases where code is split over multiple line makes code far more readable. And I'm sure you can change the right margin of editor's like Atom to 100 characters.