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

Feature/uid filter #179

Merged
merged 5 commits into from
Oct 31, 2023
Merged

Feature/uid filter #179

merged 5 commits into from
Oct 31, 2023

Conversation

andre-merzky
Copy link
Member

allow to filter session by uid regex matching

@andre-merzky
Copy link
Member Author

@okilic1 , @mturilli - this should actually be ready for testing. You can now specify a regular expression (or type re.Pattern) as uid filter on a session.

@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

Merging #179 (d994675) into devel (13b5008) will decrease coverage by 0.16%.
The diff coverage is 7.14%.

@@            Coverage Diff             @@
##            devel     #179      +/-   ##
==========================================
- Coverage   22.71%   22.55%   -0.16%     
==========================================
  Files           7        7              
  Lines        1114     1126      +12     
==========================================
+ Hits          253      254       +1     
- Misses        861      872      +11     
Files Coverage Δ
src/radical/analytics/session.py 6.66% <7.14%> (+0.03%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@andre-merzky
Copy link
Member Author

andre-merzky commented Oct 2, 2023

You can test this for example with:

    pat = re.compile('^.*0$')
    s2 = session.filter(uid=pat)

    for e in s2.get():
        print('===', e.uid)

which should result in a session which has only entities whose uids end on 0:

$ ./examples/00_session_describe_rp.py ~/j/rp/rp.session.thinkie.merzky.019622.0014/
1696281856.321 : radical.analytics    : 174194 : 139899907416128 : INFO     : radical.analytics    version: 1.35.0-v1.34.0-6-g430bb2d@feature-uid_filter
using cache for rp.session.thinkie.merzky.019622.0014
=== cmgr.0000
=== stager.0000
=== pmgr_launching.0000
=== pmgr.0000
=== pilot.0000
=== tmgr_staging_input.0000
=== tmgr_scheduling.0000
=== tmgr_staging_output.0000
=== tmgr.0000
=== task.000000
=== task.000010
=== task.000020
=== task.000030
=== task.000040
=== task.000050
=== task.000060
=== task.000070
=== task.000080
=== task.000090
=== task.000100
=== task.000110
=== task.000120

Now the problem is of course to create the correct pattern :-)

@andre-merzky
Copy link
Member Author

I improved this a bit to:

    pat1 = 'pilot.0001'
    pat2 = re.compile(r'^task\..*0$')
    s2 = session.filter(uid=[pat1, pat2])

    for e in s2.get():
        print('===', e.uid)

which should be what we need I think:

$ ./examples/00_session_describe_rp.py ~/j/rp/rp.session.thinkie.merzky.019622.0014/
=== pilot.0001
=== task.000000
=== task.000010
=== task.000020
=== task.000030
=== task.000040
=== task.000050
=== task.000060
=== task.000070
=== task.000080
=== task.000090
=== task.000100
=== task.000110
=== task.000120

@andre-merzky andre-merzky marked this pull request as ready for review October 2, 2023 23:17
Copy link
Contributor

@mturilli mturilli left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks.

@andre-merzky andre-merzky merged commit 67305b4 into devel Oct 31, 2023
4 of 5 checks passed
@andre-merzky andre-merzky deleted the feature/uid_filter branch October 31, 2023 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants