New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optics registry #232
Optics registry #232
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #232 +/- ##
===========================================
+ Coverage 45.76% 46.03% +0.26%
===========================================
Files 84 85 +1
Lines 9096 9120 +24
===========================================
+ Hits 4163 4198 +35
+ Misses 4933 4922 -11
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
solcore/optics/beer_lambert.py
Outdated
else: | ||
ASC.absorptance_detailed_balance(solar_cell[j]) | ||
w = layer_object.width | ||
|
||
def alf(x): | ||
return -1 / w * np.log(np.maximum(1 - layer_object.absorptance(x), 1e-3)) | ||
return ( |
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.
This is very minor and I guess it was done by black, I am fine with it, but the return here ooks a bit weird/harder to read than before? Anyway, if black will just keep changing it back then it will be pointless to do anything about it!
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.
In that particular case, I think it makes sense to use some intermediate variables to make the code more readable. Solved!
Following #231, this PR creates a registry of the optics methods, refactoring the function methods to make them more readable and explicit on their inputs. It also refactors
solar_cell_solver.py
to make use of this registry.Must be reviewed after #231, as it builds on top of it.