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
UDF.get_method()
used to choose implementation in UDFPartRunner._run_tile
#1509
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1509 +/- ##
==========================================
- Coverage 67.65% 67.28% -0.37%
==========================================
Files 317 317
Lines 26233 26254 +21
Branches 2993 2998 +5
==========================================
- Hits 17748 17666 -82
- Misses 7940 8040 +100
- Partials 545 548 +3
☔ View full report in Codecov by Sentry. |
/azp run libertem.libertem-data |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
I think the API is/was not public though so no real requirement to do this!
Indeed, I'm fine with changing the type, no need for StrEnum
.
I had to add explicit assert isinstance(udf, UDFFrameMixin) inside _run_tile for each method in order to make mypy happy, this is just additional runtime overhead!
See the inline comment - the assert
is the safest way, but as this is very close to the inner loop, where overheads do matter quite a bit, maybe a cast
is justified here?
I haven't added any documentation yet, would have to decide if this should be public facing?
Indeed. If this is needed for #1304 or similar UDFs, it has to become a public interface - otherwise we have a two-class system (like Apple with some of their system APIs, which can't be used by third-party apps...) and it becomes hard to reason what is actually part of the public API.
I guess this needs a small paragraph in the advanced UDF docs, and maybe some changes in the current "precedence" docs?
Co-authored-by: Alexander Clausen <alex@gc-web.de>
Co-authored-by: Alexander Clausen <alex@gc-web.de>
Co-authored-by: Alexander Clausen <alex@gc-web.de>
/azp run libertem.libertem-data |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run libertem.libertem-data |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run libertem.libertem-data |
Azure Pipelines successfully started running 1 pipeline(s). |
CI failure is unrelated, I'm re-triggering failed jobs now |
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.
Looks good! CI is still failing, somewhere in pyxem
→ pyFAI
→ numexpr
. As far as I can see, a new numexpr
release should come soon (they are aware of the breakage), so I'm inclined to just go ahead and merge now.
I did also see some logs like "No space left on device" during tests on failed CI runs ? Thanks for all the reviews and feedback! |
Yeah, that's a curious issue with our ci setup - after some time, /dev/shm in some containers runs out of space - didn't manage to find time to track down the reason for that, and re-creating the containers is a quick workaround...
You're welcome! |
Closes #1508
libertem.common.udf.UDFMethodEnum
UDF.get_method()
performs the runtime protocol check previously inUDFPartRunner._run_tile
and returns an enum member thatUDFPartRunner
matches againstUDF.get_method()
return is valid (both is an enum member, and actually implements the desired Protocol)UDF.get_method()
implementationsNotes:
get_method
is technically a breaking change, becauseUDFMethodEnum.FRAME == 'frame'
isFalse
, if we want to be completely backwards compatible we would need to use aStrEnum
(either from the PyPi package or as a backport from 3.11). I think the API is/was not public though so no real requirement to do this!assert isinstance(udf, UDFFrameMixin)
inside_run_tile
for each method in order to makemypy
happy, this is just additional runtime overhead!Contributor Checklist:
Reviewer Checklist:
/azp run libertem.libertem-data
passed