Skip to content

add omas_environment import to support additional functionality#61

Open
jguterl wants to merge 2 commits into
dgarnier:mainfrom
jguterl:main
Open

add omas_environment import to support additional functionality#61
jguterl wants to merge 2 commits into
dgarnier:mainfrom
jguterl:main

Conversation

@jguterl

@jguterl jguterl commented Apr 21, 2026

Copy link
Copy Markdown

No description provided.

Comment thread python/dipoleq/mas.py


def fill_ds(m: Machine, eq: DS, wall: DS, time_index: int | None, time: float) -> None:
def fill_ds(m: Machine, eq: DS, wall: DS, time_index: int | None, time: float,enforce_boundary_import=True) -> None:

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

needs space.. ruff --fix will do it.

Comment thread python/dipoleq/omas.py
os.environ["HOME"] = str(Path("~").expanduser()) # os.path.expanduser("~")

from omas import ODS # type: ignore[import-untyped]
from omas import ODS, omas_environment # type: ignore[import-untyped]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

you are importing this, but there is no place where its used. I think this needs to be used a context for doing ods operations somewhere... maybe you wanted to specify the cocos with this line?

Comment thread python/dipoleq/omas.py

def to_omas(
m: Machine, ods: ODS | None = None, time_index: int | None = None, time: float = 0.0
m: Machine, ods: ODS | None = None, time_index: int | None = None, time: float = 0.0, **kwargs

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I prefer you not to use unarmed keywords. No way of getting the documentation or typing correct. Please just propagate upward the keyword and documenting.

Comment thread python/dipoleq/omas.py
ods, eq, wall = prepare_omas_ds(ods)

fill_ds(m, eq, wall, time_index, time)
fill_ds(m, eq, wall, time_index, time, **kwargs)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

same comment.

Comment thread python/dipoleq/mas.py
add_boundary(m, eqt)
add_boundary_separatrix(m, eqt)
add_inner_boundary_separatrix(m, eqt)
if enforce_boundary_import:

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I wonder if we even care if it fails. Can we just never inforce but print a warning?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants