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

Interactive Mode and Renaming APIs #70

Merged
merged 167 commits into from
Feb 9, 2023

Conversation

cindytsai
Copy link
Collaborator

@cindytsai cindytsai commented Feb 6, 2023

Add Interactive Mode and Renaming APIs

Interactive Mode

Related Issue:

Main Feature

  • Does not terminate the whole simulation when there are errors in in situ analysis python script.
  • Can update and correct the script, get feedback from python prompt. This is like running IPython line by line during in situ process. Every python statement is run inside script's namespace, and changes will maintain throughout the following in situ process.

Renaming APIs and Changing Data Types

Naming

  • libyt API:
    yt_(action)_(OnWhatWithCamelCase)
    
    • Starts with yt since currently, libyt is specific for passing AMR grid data structure used inside yt.

Data and Their Lifetime

  • libyt only borrows labels and names (data type char*) from simulation, and it does not make a copy. We should make sure that the pointers (specifically char*) passed in have the lifetime that covers the whole in situ process.
  • I have add quotes with icon ✏️ to remind user about this in doc.

cindytsai and others added 7 commits February 5, 2023 15:32
…hem.

libyt only borrows defined names (everything about char*) from simulation, and does not make a copy.
I'm not sure do we really need to make a copy, since everything will be inside python, and if we really don't want to care about the lifetime of these char *, we can always look up inside python.
But I think it is unnecessary to make a copy or look it up inside python, since these are variables already defined in simulation. If not, then we can always assign it to a const char *.
…ws their names.

libyt only borrows defined names (everything about char*) from simulation, and does not make a copy.
I'm not sure do we really need to make a copy, since everything will be inside python, and if we really don't want to care about the lifetime of these char *, we can always look up inside python.
But I think it is unnecessary to make a copy or look it up inside python, since these are variables already defined in simulation. If not, then we can always assign it to a const char *.
…t branch in cindytsai/yt.

Will PR to yt asap.
@cindytsai cindytsai added doc Improvements or additions to documentation enhancement New feature or request paper Worthy to be put in a paper new-feature New feature. labels Feb 6, 2023
@cindytsai cindytsai self-assigned this Feb 6, 2023
@cindytsai cindytsai linked an issue Feb 6, 2023 that may be closed by this pull request
33 tasks
cindytsai and others added 11 commits February 7, 2023 10:39
Logical bug: interactive mode will stop even if that function is set to idle.
Fixed version: interactive mode only stops when function that set to run has error, or stop file is detected.
This commit is only for my own reference when using PyEval_EvalCode. My guessing : It looks like Python's error buffer should be cleared when running PyEval_EvalCode. Otherwise, it leads to segmentation fault (11), and you won't have any idea what went wrong. They should have mentioned this in their doc though.
Make yt_run_Function* and this method running python function in the same way.
…ding.

operator+= return reference in std::string.
@cindytsai
Copy link
Collaborator Author

Finally!! 🎇

@cindytsai cindytsai merged commit 205df99 into yt-project:main Feb 9, 2023
@cindytsai cindytsai deleted the PR-Reload&Rename branch February 9, 2023 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Improvements or additions to documentation enhancement New feature or request new-feature New feature. paper Worthy to be put in a paper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reload/Refresh Inline Script During Runtime
1 participant