[SyneRBI/SIRF] handle conveniences (PR #1390)

1 view
Skip to first unread message

Casper da Costa-Luis

unread,
Mar 31, 2026, 7:03:04 AMMar 31
to SyneRBI/SIRF, Subscribed
  • Handle.new convenience method
  • functools.wraps backend functions in Handle.c*
  • for discussion: what is the purpose of (unused) check_stack/inspect.stack()?

Follow-up to #1388


You can view, comment on, or merge this pull request online at:

  https://github.com/SyneRBI/SIRF/pull/1390

Commit Summary

  • 4cc22e5 Handle.new convenience method
  • f1ed8df `functools.wraps` backend functions in `Handle.c*`
  • 3f6f564 for discussion

File Changes

(5 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF/pull/1390@github.com>

Casper da Costa-Luis

unread,
Mar 31, 2026, 8:48:22 AMMar 31
to SyneRBI/SIRF, Push

@casperdcl pushed 3 commits.

  • cccc629 HANDLE convenience singleton
  • ac8c6cd `functools.wraps` backend functions in `Handle.c*`
  • 980e9b6 for discussion


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF/pull/1390/before/3f6f564c493f77e6c2ea0a9d74a4347221813d7f/after/980e9b69b64eafe6bea43de28e6245fcc1546e36@github.com>

Kris Thielemans

unread,
Mar 31, 2026, 7:26:14 PMMar 31
to SyneRBI/SIRF, Subscribed

@KrisThielemans approved this pull request.

ok, but now might be a good time to add a little bit of documentation on the Handle class (and indeed the new HANDLE. It is an implementation detail (should we call it _Handle in Python tradition?), but developers do need to know how this works :-)


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF/pull/1390/review/4040798034@github.com>

Casper da Costa-Luis

unread,
Apr 8, 2026, 6:57:00 AMApr 8
to SyneRBI/SIRF, Subscribed

@casperdcl commented on this pull request.


In src/common/Utilities.py:

> @@ -36,7 +37,7 @@
 class Handle:
     def __init__(self, handle, check_stack: int | None = None):
         if (check_stack is None or check_stack >= 0) and pyiutil.executionStatus(handle) != 0:
-            check_stack = inspect.stack()[1 if check_stack is None else check_stack]
+            check_stack = inspect.stack()[1 if check_stack is None else check_stack] # TODO: delete or print this?

/CC @evgueni-ovtchinnikov


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF/pull/1390/review/4074597143@github.com>

Evgueni Ovtchinnikov

unread,
Apr 10, 2026, 7:48:58 AMApr 10
to SyneRBI/SIRF, Subscribed

@evgueni-ovtchinnikov commented on this pull request.


In src/common/Utilities.py:

> @@ -36,7 +37,7 @@
 class Handle:
     def __init__(self, handle, check_stack: int | None = None):
         if (check_stack is None or check_stack >= 0) and pyiutil.executionStatus(handle) != 0:
-            check_stack = inspect.stack()[1 if check_stack is None else check_stack]
+            check_stack = inspect.stack()[1 if check_stack is None else check_stack] # TODO: delete or print this?

delete unused lines 40-43 please (not much help anyway as the error may be higher up the stack than level 1)


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF/pull/1390/review/4089359076@github.com>

Evgueni Ovtchinnikov

unread,
Apr 15, 2026, 12:08:32 PMApr 15
to SyneRBI/SIRF, Subscribed

@evgueni-ovtchinnikov commented on this pull request.


In src/common/Utilities.py:

> @@ -36,7 +37,7 @@
 class Handle:
     def __init__(self, handle, check_stack: int | None = None):
         if (check_stack is None or check_stack >= 0) and pyiutil.executionStatus(handle) != 0:
-            check_stack = inspect.stack()[1 if check_stack is None else check_stack]
+            check_stack = inspect.stack()[1 if check_stack is None else check_stack] # TODO: delete or print this?

Re the purpose of inspect.stack: what I wanted was to get closer to the line that throws monkey wrench.

For example: running PET demos I get

`Error opening file acf.hs\n' exception caught at line 427 of /home/sirfuser/devel/buildVM/sources/SIRF/src/xSTIR/cSTIR/cstir.cpp

but actual failure happens in STIR function ProjData::read_from_file called either at line 694 or line 852 of SIRF's stir_data_containers.h depending on the storage scheme (file or memory).


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF/pull/1390/review/4115075025@github.com>

Casper da Costa-Luis

unread,
Apr 28, 2026, 8:58:31 AM (10 days ago) Apr 28
to SyneRBI/SIRF, Push

@casperdcl pushed 3 commits.

  • ba680a9 HANDLE convenience singleton
  • e47db1a `functools.wraps` backend functions in `Handle.c*`
  • 1145c42 add `Handle` docstring & drop `inspect.stack()`

Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF/pull/1390/before/980e9b69b64eafe6bea43de28e6245fcc1546e36/after/1145c42e9a4049ae2cc19eef8a10703b16be4195@github.com>

Casper da Costa-Luis

unread,
Apr 28, 2026, 4:00:00 PM (10 days ago) Apr 28
to SyneRBI/SIRF, Subscribed

Merged #1390 into master.


Reply to this email directly, view it on GitHub, or unsubscribe.

Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF/pull/1390/issue_event/24963475482@github.com>

Reply all
Reply to author
Forward
0 new messages