-
Notifications
You must be signed in to change notification settings - Fork 21
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
Moved resample out of parsers to its own sub-package #158
Conversation
I can't merge this until it passes tests, so we need to understand why tests are not running..... |
d6757fc
to
0d6b1b8
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #158 +/- ##
=======================================
Coverage 99.17% 99.17%
=======================================
Files 7 7
Lines 242 243 +1
=======================================
+ Hits 240 241 +1
Misses 2 2
|
@sbillinge Ready for review. PR-test successfully ran after merging Bob's codecov fix @bobleesj I had to revert the deletions in parser's |
@alisnwu I will give it a quick look. @sbillinge Plz hold on for me! |
@alisnwu I've tested. I recommend removing these manual relative imports below in the from .loaddata import loadData
from .serialization import deserialize_data, serialize_data The use of relative imports makes our documentation more confusing and we also have to maintain this file each time we create a new function. Hence, for now you can simply change from
to
etc. |
Additionally, we use |
@bobleesj is correct. We never use relative path imports and we use cobra_case. If you haven't done so yet, please take the time to read Guido van Rossum's PEP8, which we follow....but it is worth reading it. |
@bobleesj I got rid of the relative path imports and renamed the functions and files, can you check if everything is good |
@@ -17,7 +17,7 @@ | |||
) | |||
|
|||
|
|||
class Diffraction_object: | |||
class diffraction_object: |
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.
Although this wasn't discussed before, could we try CamelCase
?
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.
Actually, not camel case which is not the PEP8 standard, but Classes always begin with capital letters. Please everyone read the PEP8 standards....
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.
Seems it's got two interpretations:
while PEP8 says,
CapitalizedWords (or CapWords, or CamelCase – so named because of the bumpy look of its letters [4]). This is also sometimes known as StudlyCaps.
but yeah I guess CapWords
works..
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.
Actually, not camel case which is not the PEP8 standard, but Classes always begin with capital letters. Please everyone read the PEP8 standards....
yeah I will add this to our gitlab so that we can say, "did you read that section" or "refer to here.."
@@ -29,7 +29,7 @@ def __init__(self, name="", wavelength=None): | |||
self.metadata = {} | |||
|
|||
def __eq__(self, other): | |||
if not isinstance(other, Diffraction_object): | |||
if not isinstance(other, diffraction_object): |
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.
also - if it's camelcased, then it improves readability in lines like here
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 rest looks good to me. if you also have other parts of the code that you could apply the PEP 8 standards, that would be amazing.
@alisnwu In the CI Codecov upload fails after a consecutive commit. This is indeed a bug. This wasn't happening when I was testing it. It appears it's being investigated here codecov/codecov-action#1580 I will also further look into this. @sbillinge pytest is running well.
|
news/resample-relocation.rst
Outdated
|
||
**Changed:** | ||
|
||
* Moved resampler out of parsers, new path is diffpy.utils.resample |
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.
@alisnwu I think we are using reampler.py?
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.
Will update the news file
@sbillinge @alisnwu suddenly codecov working again! magic |
@alisnwu great discussion on here. When it is resolved, let's do this over on a new clean branch, but refer back to this PR in the comments mentioning that the discussion is over here. |
@sbillinge @bobleesj removing the relative path imports in the parsers module is going to break a lot of code (such as that in |
Thanks @Sparks29032 It seems like From the package list you've mentioned in the Slack channel, it appears Originally we wanted to gracefully handle this using deprecation. @sbillinge will wait for your response. |
Yes, pdfgui uses its own loadData, so it is not affected. It may be good to migrate to using that of diffpy.utils so we don't have to maintain two. The other packages have been tested, and they do not use the directory level imports (apart from PDFmorph, which has been updated in a PR). We should be good to go, but this is something we should keep in mind before we make these kinds of updates. |
@Sparks29032 thanks Andrew for checking and the PRs. Indeed, I agree that we need to handle changes gracefully and it was something I figured out the last few days. |
closes #138
@sbillinge Ready for review