-
Notifications
You must be signed in to change notification settings - Fork 40
replace OpticalSystem with AbstractOpticalSystem #126
Conversation
Codecov Report
@@ Coverage Diff @@
## main #126 +/- ##
=======================================
Coverage 48.37% 48.37%
=======================================
Files 65 65
Lines 6659 6659
=======================================
Hits 3221 3221
Misses 3438 3438
Continue to review full report at Codecov.
|
I think there are more cases of this (abstract type names not following naming |
I'm not sure that all abstract types should be named as It would be good to establish a convention, though.
|
I gave the wrong justification. The correct justification is when the abstract type and its subtypes have common substrings. When they do the abstract type is prefixed with Abstract so it is easier to distinguish the types. At least this seems to be the pattern in the Julia core libararies. We don't need to prefix all our abstract types with Abstract, just the ones that fit this pattern. Number does not share a substring with Complex or Real so it stays Number. By contrast, AbstractFloat shares a substring with BigFloat, Float64, etc., so it's prefixed Abstract. Similarly, AbstractVector shares a substring with SVector and Vector so it's prefixed Abstract. OpticalSystem shares a substring with CSGOpticalSystem and AxisymmetricOpticalSystem so it seems consistent to prefix it with Abstract. |
@alfredclwong @galran @friggog if you agree with the logic of my last comment could one of you approve this PR? |
We should try and follow this pattern elsewhere too (if there are other cases) - or consider renaming other types to improve consistency. I feel like a lot of stuff was named somewhat randomly to start with (with me being the primary culprit) and hasn't been renamed since, now we are aiming for clean extensible code that others can use this should take higher priority. This is certainly a step in the right direction :) |
Pull Request Template
Description
OpticalSystem is an abstract type. Standard Julia coding style is for all abstract types to begin with Abstract
Fixes #125
Type of change
How Has This Been Tested?
ran unit tests locally
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration(s):
Checklist: