MIT-PSFC / disruption-py

An open-source physics-based Scientific Framework for Disruption Analysis of Fusion Plasmas for AI/ML applications
https://mit-psfc.github.io/disruption-py/
MIT License
11 stars 0 forks source link

Fix unused variables #308

Closed gtrevisan closed 2 months ago

gtrevisan commented 2 months ago

fix:

test with:

make pylint-only CODE=W0612
gtrevisan commented 2 months ago

@yumouwei please LMK whether you are able to take a look at the rest!

https://github.com/MIT-PSFC/disruption-py/blob/d079c308a591172b4986d6a8bb32f8e241441fd1/disruption_py/machine/d3d/physics.py#L995

and basically the whole method here: https://github.com/MIT-PSFC/disruption-py/blob/d079c308a591172b4986d6a8bb32f8e241441fd1/disruption_py/machine/d3d/physics.py#L1215-L1248

yumouwei commented 2 months ago

@yumouwei please LMK whether you are able to take a look at the rest!

https://github.com/MIT-PSFC/disruption-py/blob/d079c308a591172b4986d6a8bb32f8e241441fd1/disruption_py/machine/d3d/physics.py#L995

https://github.com/MIT-PSFC/disruption-py/blob/d079c308a591172b4986d6a8bb32f8e241441fd1/disruption_py/machine/d3d/physics.py#L1055

Can you add _get_ne_te(params, data_source=ts_data_type) here? The logic for selecting TS data source is partially implemented but not actually being used.

(disruption-py) https://github.com/MIT-PSFC/disruption-py/blob/d079c308a591172b4986d6a8bb32f8e241441fd1/disruption_py/machine/d3d/physics.py#L1489-L1499 (MATLAB) https://github.com/MIT-PSFC/disruption-py/blob/5a13906aba52b22fc4119e7f867443d7936f3d03/DIII-D/utils/load_ne_Te.m#L19-L31

yumouwei commented 2 months ago

and basically the whole method here:

https://github.com/MIT-PSFC/disruption-py/blob/d079c308a591172b4986d6a8bb32f8e241441fd1/disruption_py/machine/d3d/physics.py#L1215-L1248

Looks like this efitmap_Rz_to_rho is an earlier version of efit_Rz_interp (which is used in computing the TS peaking factors) and is called in calc_pfs.m (also an older version of get_peaking_factors_d3d.m which is translated in disruption-py). So go ahead and remove this.