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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify get_components #510

Merged

Conversation

JoranAngevaare
Copy link
Member

What is the problem / what does the code in this PR do

  • Use self.key_for in get_components instead of strax.DataKey
  • add a small test. I thought something did not work well but actually, it does.

@JoranAngevaare JoranAngevaare marked this pull request as ready for review August 9, 2021 14:45
@WenzDaniel
Copy link
Collaborator

WenzDaniel commented Aug 10, 2021

Use self.key_for in get_components instead of strax.DataKey

Anything else you changed? It is hard to tell with all those renaming,

@JoranAngevaare
Copy link
Member Author

Use self.key_for in get_components instead of strax.DataKey

Anything else you changed? It is hard to tell with all those renaming,

Not much no, I changed that twice and added a small test. I'm half doubting if such a cleanup of code is worth changing the git history but on the other hand, it took me some time to understand the code because of these naming conventions. What do you think?

@WenzDaniel
Copy link
Collaborator

WenzDaniel commented Aug 10, 2021

I think it is fine. I was just wondering if there is anything I have to pay special attention to.

Copy link
Collaborator

@WenzDaniel WenzDaniel left a comment

Choose a reason for hiding this comment

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

Okay I think it is fine. Only two things could we name it target inside cache(target) instead of target_i? Inside the function there is not any loop so I think target_i makes it a bit confusing. Instead I would suggest to use target_i in lines 869 and 870.

This PR also affects multiple other PRs like #512 and #509. Which one to merge first?

One question so it seems like you would like to use name_i as the new convention when ever we loop over something. Is this correct? This is fine with me, but what would be the convention for the corresponding index in that case? e,g "ind_target"? We just should agree on something.

@JoranAngevaare
Copy link
Member Author

This PR also affects multiple other PRs like #512 and #509. Which one to merge first?

sure, any deps should be easy to solve

One question so it seems like you would like to use name_i as the new convention when ever we loop over something. Is this correct? This is fine with me, but what would be the convention for the corresponding index in that case? e,g "ind_target"? We just should agree on something.

So the reason I used target_i was that targets was already in the same scope and I try avoiding using target and targets in the same scope as I think this makes for unclear code. this_target was the other option I was contemplating but it's more letters. Maybe you have another suggestion of a convention that makes sense?

@WenzDaniel
Copy link
Collaborator

Okay I see no, lets leave target_i then.

@WenzDaniel WenzDaniel merged commit 996324e into AxFoundation:master Aug 19, 2021
WenzDaniel added a commit that referenced this pull request Aug 19, 2021
@JoranAngevaare JoranAngevaare deleted the simplify_get_components branch August 19, 2021 12:05
WenzDaniel added a commit that referenced this pull request Aug 19, 2021
@WenzDaniel WenzDaniel mentioned this pull request Aug 23, 2021
JoranAngevaare added a commit that referenced this pull request Aug 25, 2021
* Prepare test for double_dependency issue

* Added lock conditions with logger informations.

* Added test for double dependency.

* Add small counter to fix double dependency problem

* Add test to trigger multiprocess error

* Add pytestdebug log to ignored files

* Add loader plugins to processor components

* Modify inline plugin to fix loader bug

* Add comments, add tests if data is stored

* Change naming according to #510

* Change naming according to #510

* Add comment and logging

* Fix flag

* Move mailbox up

* Update flow freely to account for double dependency plugins

* Added log statement

* Fixed f-string in logging

* Update strax/mailbox.py

* Add comment

Co-authored-by: Joran Angevaare <jorana@nikhef.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants