Skip to content

Simplify syntax to get data from PTDATA #440

Closed
yumouwei wants to merge 3 commits intodevfrom
wei/resolve-d3d-ptdata-path
Closed

Simplify syntax to get data from PTDATA #440
yumouwei wants to merge 3 commits intodevfrom
wei/resolve-d3d-ptdata-path

Conversation

@yumouwei
Copy link
Copy Markdown
Contributor

@yumouwei yumouwei commented Apr 9, 2025

This PR allows a user to use

conn.get_data('ip', tree_name='ptdata')

to replace

conn.get_data(f'ptdata("ip", {params.shot_id}, tree_name='d3d')
conn.get_data(f'ptdata("ip", {params.shot_id}, tree_name=None)

For the moment, this is only needed for using SignalTimeSetting with PTDATA signals on DIII-D. Therefore I did not modify any expression in d3d/physics.py or anywhere else. It also only works with simple expressions (i.e. it won't work with additional arithmetic operations).

@yumouwei yumouwei mentioned this pull request Apr 9, 2025
9 tasks
@yumouwei yumouwei added the machine: DIII-D Related to the DIII-D tokamak label Apr 9, 2025
@yumouwei
Copy link
Copy Markdown
Contributor Author

yumouwei commented Apr 9, 2025

I just found out that conn.get_data(f'ptdata("ip", {params.shot_id}, ...') doesn't need specifying tree_name. We should remove all the tree_name="d3d" to save the time used in opening those trees.

Copy link
Copy Markdown
Member

@gtrevisan gtrevisan left a comment

Choose a reason for hiding this comment

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

the inout module is machine-agnostic, could we move this somewhere else in the DIII-D-specific module? maybe a helper function somewhere?

@yumouwei yumouwei closed this Apr 25, 2025
@yumouwei
Copy link
Copy Markdown
Contributor Author

yumouwei commented Apr 25, 2025

In terms of using PTDATA signal in SignalTimeSetting, for now this is addressed by the _get_times_d3d_wrapper added in #439. We decided not to modify mds.py following the above discussion.

@gtrevisan gtrevisan deleted the wei/resolve-d3d-ptdata-path branch April 28, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

machine: DIII-D Related to the DIII-D tokamak

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants