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

groupby() by variables that not present in the entire data space #321

Closed
salazardetroya opened this issue Apr 7, 2020 · 5 comments · Fixed by #323
Closed

groupby() by variables that not present in the entire data space #321

salazardetroya opened this issue Apr 7, 2020 · 5 comments · Fixed by #323
Assignees
Labels
enhancement New feature or request

Comments

@salazardetroya
Copy link

Feature description

I am interested in obtaining all the jobs that contain a variable b which does not necessarily have to be present in all the jobs.

Proposed solution

From @bdice in the slack group:

Bradley Dice 10:43 AM
@miguel This behavior could be improved, but what would you expect the behavior to be? A group where b is None isn't really an option because b could be set to None in the statepoint. We could return only groups where the value is set (and ignore jobs where the key is missing).

Additional context

Example of the current problem. First groupby() works, second does not.

import signac

project = signac.init_project('test')
sp = { 'a' : 1.0,
       'c' : 2.0
        }
job = project.open_job(sp)
job.init()

sp = { 'a' : 2.0,
       'b' : 1.0,
        }
job = project.open_job(sp)
job.init()

sp = { 'a' : 1.0,
       'b' : 3.0,
        }
job = project.open_job(sp)
job.init()

for a, group in project.groupby('a'):
    print(a, list(group))

for b, group in project.groupby('b'):
    print(b, list(group))
@csadorf csadorf added the enhancement New feature or request label Apr 8, 2020
@vishav1771
Copy link
Contributor

@csadorf I will like to work on it.

@vyasr
Copy link
Contributor

vyasr commented Apr 8, 2020

@vishav1771 I'm happy to assign you to this, but keep in mind that you're already assigned to #314 and #297 so do you want to try and wrap one of those up first (probably #314) before tackling this, or do you feel comfortable working on three issues at once?

@vyasr
Copy link
Contributor

vyasr commented Apr 8, 2020

Well apparently you can handle another issue just fine :)

@csadorf
Copy link
Contributor

csadorf commented Apr 9, 2020

@salazardetroya Would it be possible for you to verify that #323 implements your expected behavior?

@salazardetroya
Copy link
Author

Yes, I can run the above example so I'm good, thanks @vishav1771 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants