Uh oh!
There was an error while loading. Please reload this page.
Moved resample out of parsers to its own sub-package - #158
Conversation
sbillinge
commented
Nov 7, 2024
I can't merge this until it passes tests, so we need to understand why tests are not running..... |
d6757fc to
0d6b1b8CompareCodecov 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 |
bobleesj
commented
Nov 7, 2024
@alisnwu I will give it a quick look. @sbillinge Plz hold on for me! |
bobleesj
commented
Nov 7, 2024
@alisnwu I've tested. I recommend removing these manual relative imports below in the from .loaddataimportloadDatafrom .serializationimportdeserialize_data, serialize_dataThe 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. |
bobleesj
commented
Nov 7, 2024
Additionally, we use |
sbillinge
commented
Nov 7, 2024
@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. |
alisnwu
commented
Nov 7, 2024
@bobleesj I got rid of the relative path imports and renamed the functions and files, can you check if everything is good |
| class Diffraction_object: | ||
| class diffraction_object: |
There was a problem hiding this comment.
Although this wasn't discussed before, could we try CamelCase?
There was a problem hiding this comment.
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.
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.
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.."
| def __eq__(self, other): | ||
| if not isinstance(other, Diffraction_object): | ||
| if not isinstance(other, diffraction_object): |
There was a problem hiding this comment.
also - if it's camelcased, then it improves readability in lines like here
bobleesj
left a comment
There was a problem hiding this comment.
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.
bobleesj
commented
Nov 7, 2024
@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. |
| **Changed:** | ||
| * Moved resampler out of parsers, new path is diffpy.utils.resample |
bobleesj
commented
Nov 7, 2024
@sbillinge@alisnwu suddenly codecov working again! magic |
sbillinge
commented
Nov 7, 2024
@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. |
Sparks29032
commented
Nov 11, 2024
@sbillinge@bobleesj removing the relative path imports in the parsers module is going to break a lot of code (such as that in |
bobleesj
commented
Nov 11, 2024
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. |
Sparks29032
commented
Nov 11, 2024
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. |
bobleesj
commented
Nov 11, 2024
@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