Skip to content
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

[Restructure/plasma] Initial Opacities Refactor #2609

Merged

Conversation

wkerzendorf
Copy link
Member

@wkerzendorf wkerzendorf commented May 6, 2024

linelist with 29k lines and 10 shells is slower by a factor of 3 in the new implementation (but I think this is shrinking with more lines; used to be a factor >5 for 247 lines).
Function took 0.001744791865348816 seconds to run
Function took 0.0059948337730020285 seconds to run

@wkerzendorf wkerzendorf changed the title add isotopic_number_density Opacities Refactor May 6, 2024
@wkerzendorf wkerzendorf force-pushed the restructure/plasma_opacities branch from 2fbdbc1 to e804942 Compare May 6, 2024 20:38
…ace.py, transport_montecarlo_numba_interface.py, conftest.py, formal_integral.py, base.py, and macro_atom.py
@andrewfullard andrewfullard self-requested a review May 7, 2024 16:06
@andrewfullard andrewfullard added restructure opacity Related to opacity extensions in TARDIS labels May 7, 2024
transition_type = macro_atom_data.transition_type.values
lines_idx = macro_atom_data.lines_idx.values
tpos = macro_atom_data.transition_probability.values
util.calculate_transition_probabilities(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't like having two functions with identical names here, especially if one is in util of all places. But I'm not sure if this is your change or not.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still draft I think

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not my change - but I'll have a look

)
return transition_probabilities

def _normalize_transition_probabilities(self, transition_probabilities):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is better duplication since it is underscored. But why is it in util?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is in util. Can yiu check. I think it doesn't work but is never tested.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On master it points at macro_atom but the function is not defined or used anywhere. So you could just delete it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

tardis/opacities/opacity_state.py Show resolved Hide resolved
tardis/opacities/tau_sobolev.py Outdated Show resolved Hide resolved
@Knights-Templars
Copy link
Member

docstrings?

@Knights-Templars Knights-Templars marked this pull request as draft May 20, 2024 14:21
@jvshields
Copy link
Contributor

Would be nice for the refactor pr to be separate from the functional code change pr.

@tardis-bot
Copy link
Contributor

tardis-bot commented May 23, 2024

*beep* *bop*

Hi, human.

The docs workflow has succeeded ✔️

Click here to see your results.

@wkerzendorf
Copy link
Member Author

@andrewfullard - I believe this is based on the transport refactor, right?

@wkerzendorf wkerzendorf marked this pull request as ready for review June 8, 2024 11:17
@andrewfullard
Copy link
Contributor

run black on file

Copy link
Contributor

@andrewfullard andrewfullard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add docstrings, check constant usage, run black, make issue re: opacitystate

@wkerzendorf
Copy link
Member Author

Add docstrings, check constant usage, run black, make issue re: opacitystate

I think resolved.

Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 70.24390% with 61 lines in your changes missing coverage. Please review.

Project coverage is 67.80%. Comparing base (26b6005) to head (3379062).

Files Patch % Lines
tardis/opacities/opacity_state.py 54.32% 37 Missing ⚠️
tardis/opacities/macro_atom/base.py 78.57% 12 Missing ⚠️
tardis/energy_input/gamma_packet_loop.py 0.00% 5 Missing ⚠️
tardis/energy_input/gamma_ray_estimators.py 0.00% 2 Missing ⚠️
tardis/energy_input/gamma_ray_transport.py 0.00% 2 Missing ⚠️
tardis/opacities/tau_sobolev.py 92.30% 2 Missing ⚠️
tardis/radiation_field/base.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2609      +/-   ##
==========================================
- Coverage   67.89%   67.80%   -0.10%     
==========================================
  Files         174      177       +3     
  Lines       14439    14534      +95     
==========================================
+ Hits         9804     9855      +51     
- Misses       4635     4679      +44     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wkerzendorf wkerzendorf changed the title Opacities Refactor [Restructure/plasma] Initial Opacities Refactor Jun 19, 2024
@andrewfullard andrewfullard self-requested a review June 21, 2024 14:11
@andrewfullard andrewfullard enabled auto-merge (squash) June 21, 2024 14:14
@andrewfullard andrewfullard merged commit 50866fc into tardis-sn:master Jun 21, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-docs opacity Related to opacity extensions in TARDIS restructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants