Closed licode closed 6 years ago
Merging #61 into master will decrease coverage by
0.2%
. The diff coverage is0%
.
@@ Coverage Diff @@
## master #61 +/- ##
==========================================
- Coverage 28.92% 28.72% -0.21%
==========================================
Files 10 10
Lines 280 282 +2
==========================================
Hits 81 81
- Misses 199 201 +2
Impacted Files | Coverage Δ | |
---|---|---|
csxtools/utils.py | 20% <0%> (-0.41%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 3727870...8a4e8ca. Read the comment docs.
@mpmdean What is the expected signature of this function?
@tacaswell
Below is the error from the latest CSX kernal on srv1. It's trying to access the _get_images method on the list of two headers. This works in older kernals.
AttributeError Traceback (most recent call last) in () 3 4 old_scan_no = 85528 ----> 5 slicerator = get_fastccd_images(db[old_scan_no], (db[old_scan_no-1, old_scan_no+1], None, None))
/opt/conda_envs/analysis-2018-1.0/lib/python3.6/site-packages/csxtools/utils.py in get_fastccd_images(light_header, dark_headers, flat, gain, tag, roi) 85 # Get the images 86 ---> 87 bgnd_events = _get_images(d, tag, roi) 88 89 # We assume that all images are for the background
/opt/conda_envs/analysis-2018-1.0/lib/python3.6/site-packages/csxtools/utils.py in _get_images(header, tag, roi) 179 def _get_images(header, tag, roi=None): 180 t = ttime.time() --> 181 images = header.db.get_images(header, tag) 182 t = ttime.time() - t 183 logger.info("Took %.3f seconds to read data using get_images", t)
AttributeError: 'list' object has no attribute 'db'
I believe this comes from this change:
-def _get_images(header, tag, roi=None, handler_override=None): +def _get_images(header, tag, roi=None): t = ttime.time()
images = get_images(header, tag, handler_override=handler_override) images = header.db.get_images(header, tag) results in an incompatibility described below. Or at least something that previously worked now does not. The variable header becomes a list if one wants to use.
I think this should work. I also did some local test. any more comment?
Hi All,
I am using the current version of the SRV1 server at CSX (assuming /opt/conda_envs/analysis-2018-2.1
). The version of csxtools is '0.1.13'. I am unable to use multiple dark images, but the discussion here indicates that this is the fix. what version of csxtools is supposed to this ability repaired?
I am not sure what happened, but now this functionality seems to work. What is very scary is that the version of csxtools remains the same so I don't really understand why I had the issue in the first place. I tried all 3 23id1 servers before and found this issue. But just this week, I forgot and ran other notebooks and it seemed to be fixed. I am going to close the issue on csxtools
This is to be compatible with previous api that _get_images can take list of headers as input.