z_order below 200 is never used?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 20/100
Hướng nghiên cứu
The issue points to OpticsManager, Effect and its subclasses, including TERCurve, PSF, SurfaceList and PupilTransmission. First trace the get_z_order_effects() calls and how effects are applied to FovVolumeList; the issue leaves the preferred design unresolved. Done means explaining the z-order behavior and agreeing on a direction with the maintainers before changing the effect system.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I looked through the OpticsManager and noticed that a) there's no call to .get_z_order_effects() for z_orders below 100 and b) the call .get_z_order_effects(100) (which accesses z_orders between 100 and 199) is only used in .system_transmission and .surfaces_table, both properties are not used anywhere in the codebase (except unit tests). It would appear to me that any z_order below 200 is never actually used and thus completely redundant. This has a few interesting consequences:
This means for example that any TERCurve is only applied to FovVolumeList when it happens to be the current element of a wheel effect, which has a 2xx-range z_order. So e.g. SkycalcTERCurve is never applied to FovVolumeList.
For the PSFs, it mostly works, because the various PSF subclasses that are actually used override the z_order and set something in the 2xx-range. I generally don't understand how the z_orders are chosen for the PSFs. E.g., the simple SeeingPSF has z_order = (242, 642), its base class AnalyticalPSF has z_order = (41, 641) and its base class PSF has z_order = (40, 640). So using the final SeeingPSF will be applied as expected because it has a 2xx-range z_order. I understand the final digit change so that no two effects have the same z_order (which doesn't make any practical difference, because only the "hundreds digit" is considered anyway). But why does the PSF then not have 240 but 40, and the AnalyticalPSF 41 and not 241?
Any SurfaceList effect (of which there are a few) is only ever applied to the source, its 20 and 120 z_orders seem to have no effect whatsoever. The same is true for PupilTransmission and its 10 and 110 (inherited from TERCurve).
Now, I'm not sure if I'm missing anything here, or if there was a good reason to choose e.g. which TERCurve subclass will be applied to FovVolumeList and which won't. In any case, all this is IMNSHO a clear case for eventually ditching the z_order completely and dealing with this in another way. There was some discussion about this already some time ago I believe. I currently see two options:
- Use an in-between base class layer for
Effector alternatively mixin classes so that we can do something likeisinstance(eff, FovSetupEffect). This might have the advantage that we could add methods like e.g.FovSetupEffect._apply_to_fov_volume_list()(which is then dispatched to by the normal.apply_to()) that has araise NotImplementedErrorin the abstract base class, such that is we subclass an effect with the intention of applying it to e.g. the FOV setup phase, but forget to implement the relevant part of the.apply_to(), we'd notice immediately. - Given that the various
.apply_to(obj, ...)methods are written such that ifobjis not the correct type (or one of several) to apply this effect to, theobjis returned as-is, i.e. a straight pass-through. This might be used to simply always apply all effect everywhere, and the ones that don't apply to the current type ofobjare then simply ignored. This approach seems a bit messy on one hand, but on the other hand we could just keep a global (perOpticalTrainthat is) list of effects and be done with it.
I used to have option 1 in the back of my mind for a while, thinking that I'd probably want to go there eventually. But now I'm not so sure anymore, because option 2 also seems appealing. Thoughts @hugobuddel ?
Also, I need to talk to @astronomyk once he's back from vacation about the original motivation behind the <200 z_orders and the case of applying some subclasses of the same base to the setup phase but not others...
- Ngôn ngữ chính
- Python
- Star
- 42
- Fork
- 30
- Merge trung bình
- 2 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AstarVienna/ScopeSim
-
effects performance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
AstarVienna/ScopeSim#1062 ·
-
optics
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
AstarVienna/ScopeSim#1061 ·
-
optics
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 69/100
AstarVienna/ScopeSim#1060 ·
-
SkycalcTERCurve validate fails with non-allowed valuesCó thể làm lại được @oczoske đã nhận 43 ngày trước và không có pull request nào đang mở. Đang mởeffects
AstarVienna/ScopeSim#1049 · 2 bình luận · 1 người được giao ·
-
MICADO mixed detector readout modeCó thể làm lại được @oczoske đã nhận 44 ngày trước và không có pull request nào đang mở. Đang mởeffects imaging instrument-specific Science Team
AstarVienna/ScopeSim#1048 · 1 người được giao ·
Tất cả issue của AstarVienna/ScopeSim
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
qboson/kaiwu-pytorch-plugin#2308 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
NL-BioImaging/biomero-converter#43 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Name the maintainers in CODEOWNERSCó thể đã có người làm @TorecLuik đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
NL-BioImaging/BIOMERO.shallower#41 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
soup drift-alarm drops malformed and unrecognised live rows without saying so, then reports OK on the rows that are leftCó thể đã có người làm @abdulwaarith0 đã nhận hôm nay. Đang mởneeds-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
MakazhanAlpamys/Soup#3665 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
roadmap/v1.3.0 scope/entitlement type/improvement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
databrickslabs/ontos#1778 ·
Maintainer thường phản hồi trong vòng 2 ngày