-
Notifications
You must be signed in to change notification settings - Fork 40
Conversation
1. rm Emitter2.jl 2. split Emitters.jl into separate submodule files 3. mv Emitters.Visualization -> Vis 4. rm hacky root-level include("Emitters.jl") 5. fix incorrect import statements
This comment has been minimized.
This comment has been minimized.
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.
The deep nesting of modules still seems unnecessarily complicated to me but in the interests of making progress let's try this out and see how it works.
ad9686b
to
880cfaa
Compare
@galran I've now set the documentation build to fail on strict requirements, so we'll need to fix all the missing docstrings. This is the current list:
Could you please add references to these into the appropriate .md files in docs? Thanks. @BrianGun, the CARGILLE docstrings are a bit awkward. I think our two best options are either (1) to include a documentation page for CARGILLE, or (2) to remove CARGILLE entirely - currently it's only used once, in a testset. |
@alfredclwong if you are no longer providing docs for all glasscat catalogs (which seems like a sensible choice) then it’s probably best to just remove the docstrings from cargille, there shouldn’t be any need to remove the code Also updating the complete reference page in the docs with new sub modules (using auto docs) will remove these warnings if you don’t want dedicated docs pages for all these |
Removing the docstrings seems like the way to go. Or at least making them into multi-line comments. @BrianGun, do you have any objection to this? There is a tiny bit of convenience in seeing the glass info when you hover over a glass in the source code. autodocs also sounds good. @galran, did you want to put those docstrings in new_emitters.md at all? If not, I'll just add them to ref.md. |
I don't have any objection to removing the docstrings. |
2eba18d
to
4e6634f
Compare
@alfredclwong documentation check is failing. |
This reverts commit aa5de52.
47c8add
to
6d8f20c
Compare
* remove random whitespace * remove redundant comments above docstrings * fix docstrings to follow existing conventions * fix many function type signatures * move exports to top of files to provide clear submodule headers * Int -> Integer * added empty docstrings for generate, visual_size and apply these functions clearly need documentation
@alfredclwong it might be a problem, |
That's what I'm worried about. I feel like having abstract types in function signatures is OK, but there might be performance issues if we allow struct fields to be too generic. What's the best way to test for allocations - adding representative workloads to Benchmarks.jl? |
@galran do you have any recommendations for a representative workload for the Emitters code? If you could add these to Benchmarks.jl, it'd be very helpful. |
There are several things to consider. First what is the intent of the type? Here are the subtypes of Integer: Bool Will this code even work properly when passed all of these subtypes? Does it make sense to have this degree of generality? If the answer is no then it shouldn't be Integer. Then there is the performance consideration. In general giving struct fields abstract types will lead to poor performance for the reasons @friggog mentioned. In this particular case Int64 is probably a better idea than Integer. No performance hit, no allocation, and plenty big enough to represent enough rays to keep a computer busy for a long time (billions of seconds, at least). |
Agreed, I'll revert the commit in a bit |
regarding the emitters, the only thing i can think of is running a couple of the examples (from the documentation or the notebook) - or at least just instantiating the non-visual part in order to not drag mesa into the mix. |
[WIP]
I didn't get a chance to review PR #79 as I was off on holiday. Having a look at it now, several things slipped through the code review. These are the most obvious fixes - when I have more time, I may have a deeper look. There are also some issues from PR #70.
OpticSim.jl/src/Optical/Emitters.jl
Lines 24 to 27 in 88a22f5
T
is unused, and inOpticSim.jl/src/Optical/Emitters.jl
Line 222 in 88a22f5
OpticSim.jl/src/Optical/Emitters.jl
Lines 36 to 40 in 88a22f5
OpticSim.jl/src/Geometry/Transform.jl
Line 44 in 88a22f5
ones(Vec3{T})
would suffice). I think there are also some instances where the type signatures could make better use of multiple dispatch.rotationd
not being in scope. I'll change the doc build Github Action to fail on things like this now (I wasn't doing this because of the zoom lens example, but I'll comment that out).OpticSim.jl/src/Optical/Emitters.jl
Lines 11 to 13 in 88a22f5
Further issues:
OpticSim.jl/src/Optical/Emitters.jl
Line 120 in 103c70f
OpticSim.jl/src/Optical/Emitters.jl
Line 1082 in 103c70f
OpticSim.jl/src/Optical/Emitters.jl
Line 188 in 103c70f
OpticSim.jl/src/Optical/Emitters.jl
Line 408 in 103c70f
OpticSim.jl/src/Optical/Emitters.jl
Lines 24 to 27 in 88a22f5