-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update/SOF-7289 Documentation on JupyterLite Dialog #270
Merged
Merged
Changes from 10 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
105efc9
feat: add jl dialog page
VsevolodX bc4c78f
upate: add a strcuture
VsevolodX bb9eddf
feat: add screenshots
VsevolodX 55f39af
update: add images
VsevolodX db0412c
update: mkdocks
VsevolodX fecc8e8
update: add gif
VsevolodX efa3a47
chore: small cleanup
VsevolodX e7cd92f
update: adjust writing with gpt-4
VsevolodX 14aab4e
update: explain data handling
VsevolodX a87d159
Merge branch 'master' into update/SOF-7289
VsevolodX 5058c69
update: remove pngs
VsevolodX 784ea44
update: adjust imgaes import
VsevolodX d9828f1
update: add webp images
VsevolodX e823b82
updapte images according to readme
VsevolodX 5143cde
chore: fix a typo
VsevolodX ed80f98
update: add alt-text
VsevolodX 96092a7
chore: fix gif
VsevolodX 0bed35d
update: add about webp
VsevolodX 7b62c56
update: use import from symlink
VsevolodX 52b48cd
update: use import from symlink 2
VsevolodX 50683ae
chore: cleanup
VsevolodX 350d8fc
chore: remove duplication in descripton
VsevolodX File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
images/materials-designer/jupyterlite-transformation-apply-transformation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
images/materials-designer/jupyterlite-transformation-input-materials.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
images/materials-designer/jupyterlite-transformation-submit-results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions
70
lang/en/docs/materials-designer/header-menu/advanced/jupyterlite-dialog.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# JupyterLite Transformation Dialog | ||
|
||
The JupyterLite Transformation Dialog enables the modification of materials within the JupyterLite environment, which is a lightweight implementation of JupyterLab that runs entirely in the browser. This dialog is accessible via the ["Advanced" menu](../advanced.md) within the Materials Designer interface. | ||
|
||
<img src="/images/materials-designer/open-jupyterlite-dialog.png" alt="Open JupyterLite Transformation Dialog"/> | ||
|
||
## JupyterLite Transformation | ||
|
||
As depicted below, the JupyterLite Transformation Dialog facilitates the transfer of materials to the Python environment, allowing for transformations within Jupyter notebooks in the JupyterLite environment. | ||
|
||
<img src="/images/materials-designer/jupyterlite-transformation.png" alt="JupyterLite Transformation Dialog"/> | ||
|
||
## Select Input Materials | ||
|
||
At the top of the dialog, a drop-down menu allows for the selection of materials to be transferred to the JupyterLite environment. These materials will then be available for further processing within JupyterLite. | ||
|
||
<img src="/images/materials-designer/jupyterlite-transformation-input-materials.png" alt="Select Input Materials"/> | ||
|
||
## Apply Transformation | ||
|
||
To apply a transformation, open the notebook containing the desired transformation from the list provided in the Introduction.ipynb notebook. Follow the instructions within to apply the transformation to the selected materials. Typically, this process involves specifying settings for the transformation and clicking "Run All Cells." | ||
|
||
<img src="/images/materials-designer/jupyterlite-transformation-apply-transformation.png" alt="Apply Transformation"/> | ||
|
||
### Access Materials in JupyterLite | ||
To access materials inside the JupyterLite environment, use function from `utils.jupyterlite` module. The following code snippet demonstrates how to access the materials inside the JupyterLite environment: | ||
|
||
```python | ||
from utils.jupyterlite import get_data | ||
|
||
get_data("materials_in", globals()) | ||
``` | ||
|
||
Parameters: | ||
|
||
The first parameter specifies the name of the global variable (`"materials_in"`) where the received data will be stored. | ||
The second parameter, `globals()`, ensures that the function operates correctly across both Pyodide and Python environments. It allows `get_data` to dynamically interact with the global namespace of the script. | ||
|
||
Data Handling: | ||
|
||
The materials data is initially stored in a global variable named `data_from_host`, which is updated in response to changes in material selection or the materials themselves. | ||
In the context of the Pyodide environment, `data_from_host` becomes available after the Pyodide kernel has loaded and the extension set the data. | ||
|
||
### Send Materials Back to Materials Designer | ||
|
||
To send the materials back to the Materials Designer, use the following code snippet: | ||
|
||
```python | ||
from utils.jupyterlite import send_data | ||
|
||
materials = [material1, material2, ...] | ||
send_data("materials", materials) | ||
``` | ||
|
||
Parameters: | ||
|
||
The first parameter specifies the data that is being sent, which is "materials" in case for materials, this shouldn't be changed. The second parameter is the list of materials in ESSE format. | ||
|
||
|
||
## Submit Results | ||
|
||
In most cases the result of the transformation is a set of materials that can be passed back to the Materials Designer. They will appear in the "Materials Out" dropdown at the bottom of the dialog. Select the materials you want to pass back to the Materials Designer and click the "Submit" button to complete the transformation. | ||
|
||
<img src="/images/materials-designer/jupyterlite-transformation-submit-results.png" alt="Submit Results"/> | ||
|
||
## Animation | ||
|
||
The following animation illustrates how to use the JupyterLite Transformation Dialog to create a matching interface between two surfaces using Zur and McGill's algorithm. | ||
|
||
<img src="/images/materials-designer/jupyterlite-session-dialog.gif" alt="JupyterLite Transformation Dialog Animation"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make sure the images are:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last time, we did add brief info about webp in the INTERNAL.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably it's better to have it in the README under "including images" section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep it in README, probably more visible