-
Notifications
You must be signed in to change notification settings - Fork 23
Add server tutorials to the main tutorials branch #1891
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
Open
luisaFelixSalles
wants to merge
70
commits into
main
Choose a base branch
from
tutorials/dpf_server/2-switch-between-local-and-remote-server
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 22 commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
b6a4928
new tutorials layout
luisaFelixSalles bc998a3
user guide index page with tutorials
luisaFelixSalles bd08a1e
add new basic tutorial and jupyter_ sphinx extension
luisaFelixSalles 64b4a63
add new basic tutorial in the sidebar
luisaFelixSalles 992c045
add new fundamentals tutorial page
luisaFelixSalles a0d288e
reorganizing
luisaFelixSalles f616dd1
add fundamentals and usage tutorials and their sections
luisaFelixSalles 7c79417
add more required tutorials
luisaFelixSalles 0046af2
folders and index files for each tut section
luisaFelixSalles 456b54d
update distributed files section grid
luisaFelixSalles 3421141
updates
luisaFelixSalles 4a2e9d3
layout changes
luisaFelixSalles db55259
updates on the index cards
luisaFelixSalles 51fc7b9
updates on the index pages
luisaFelixSalles 4de2bf1
updates on the basic tuts
luisaFelixSalles be5197c
updates
luisaFelixSalles f5f8f88
updates
luisaFelixSalles 823289f
update tutorials main page
luisaFelixSalles cdadc07
add maths section
luisaFelixSalles df79026
add physics data section
luisaFelixSalles e081f88
adapts the "server types" how to into a licensing tutorial
luisaFelixSalles a186370
update dpf server index
luisaFelixSalles 9b9e26e
update
luisaFelixSalles 4450156
new tutorials layout
luisaFelixSalles d42da98
user guide index page with tutorials
luisaFelixSalles dbfea2e
add new basic tutorial and jupyter_ sphinx extension
luisaFelixSalles c110330
add new basic tutorial in the sidebar
luisaFelixSalles 043e864
add new fundamentals tutorial page
luisaFelixSalles 337caa6
reorganizing
luisaFelixSalles a10b628
add fundamentals and usage tutorials and their sections
luisaFelixSalles aca0c7e
add more required tutorials
luisaFelixSalles cc614ea
folders and index files for each tut section
luisaFelixSalles 26b4cbe
update distributed files section grid
luisaFelixSalles 354bdd4
updates
luisaFelixSalles 49b6fe0
layout changes
luisaFelixSalles b914cc5
updates on the index cards
luisaFelixSalles 7b5dc53
updates on the index pages
luisaFelixSalles a22d3b8
updates on the basic tuts
luisaFelixSalles d7f946c
updates
luisaFelixSalles b812bde
updates
luisaFelixSalles 1b143a8
update tutorials main page
luisaFelixSalles 85509b0
add maths section
luisaFelixSalles eea2d08
add physics data section
luisaFelixSalles d6ed508
Fix requirements/requirements_docs.txt
PProfizi bb6b859
Add badges for supported solvers (#1925)
PProfizi d596f0a
Add a links and refs file to be used in the doc (#1940)
luisaFelixSalles f2d4469
Add animation tutorials to the main tutorials branch (#1915)
luisaFelixSalles 0270c6e
Update doc/source/links_and_refs.rst
luisaFelixSalles 0a04c25
updates the ref in the Manipulating physics data card in the index.rs…
luisaFelixSalles 96b6a58
adds the "mathematics" and "manipulate physics data" sections in the …
luisaFelixSalles 850f838
adds solver badges in the beginning of the animate_time.rst tutorial
luisaFelixSalles e1dcd34
updates some lists that didn't render correctly in the animate_time.r…
luisaFelixSalles 617c55d
add jupter_sphinx extension to the conf.py file
luisaFelixSalles 14f3c78
add new links and substitution text to the links_and_refs.rst file
luisaFelixSalles b3be655
animate_time.rst use the links_and_refs.rst file
luisaFelixSalles 627c2de
changes the conf.py file so the links from the links_and_refs.rst fil…
luisaFelixSalles 293a63d
Merge branch 'refs/heads/master' into doc/new-tutorials-section
luisaFelixSalles 0a8fa75
Add tutorials guidelines in the main tutorials branch (#1950)
luisaFelixSalles d7df37a
Merge branch 'master' into doc/new-tutorials-section
PProfizi 5b90dc7
Update contributing.rst after merge
PProfizi 05b8676
fix: file path
moe-ad bf18b2f
Merge branch 'master' into doc/new-tutorials-section
PProfizi 790db91
Add import data tutorials to the main tutorials section (#1933)
luisaFelixSalles 31d7034
Add mesh tutorials to the main tutorials branch (#1908)
luisaFelixSalles 839f56e
Add plotting tutorials to the main tutorials branch (#1903)
luisaFelixSalles 5c31c41
Add math tutorials to the main tutorials branch (#1910)
luisaFelixSalles 7cea6ac
Merge branch 'master' into doc/new-tutorials-section
PProfizi 50698e4
Merge branch 'doc/new-tutorials-section' into tutorials/dpf_server/2-…
PProfizi f0f90a3
Delete doc/source/user_guide/tutorials/transform_data/index.rst
PProfizi d216631
Apply suggestions from code review
PProfizi 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,24 @@ | ||
| .. _ref_tutorials_animate: | ||
|
|
||
| ======= | ||
| Animate | ||
| ======= | ||
|
|
||
| These tutorials demonstrate how to visualise the data in an animation. | ||
|
|
||
| .. grid:: 1 1 3 3 | ||
| :gutter: 2 | ||
| :padding: 2 | ||
| :margin: 2 | ||
|
|
||
| .. grid-item-card:: Animate data | ||
| :link: ref_tutorials | ||
| :link-type: ref | ||
| :text-align: center | ||
|
|
||
| This tutorial | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 2 | ||
| :hidden: | ||
|
|
This file contains hidden or 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,42 @@ | ||
| .. _ref_tutorials_data_structures: | ||
|
|
||
| =================== | ||
| DPF data structures | ||
| =================== | ||
|
|
||
| DPF uses two main data structures to handle data: Fields and Collections. | ||
| Therefore, it is important to be aware of how the data is | ||
| structured in those containers. | ||
|
|
||
| The data containers can be: | ||
|
|
||
| - **Raw data storage structures**: Data arrays (a ``Field`` for example) or Data Maps (a ``DataTree`` for example) | ||
| - **Collections**: a group of same labeled objects from one DPF raw data storage structure (a ``FieldsContainer`` for example, that is a group of ``Fields`` with the same label) | ||
|
|
||
| These tutorials explains how these structures work and how you can manipulate data within. | ||
|
|
||
| .. grid:: 1 1 3 3 | ||
| :gutter: 2 | ||
| :padding: 2 | ||
| :margin: 2 | ||
|
|
||
| .. grid-item-card:: DPF raw data storage structures | ||
| :link: ref_tutorials | ||
| :link-type: ref | ||
| :text-align: center | ||
|
|
||
| This tutorial shows how to create and work with some DPF data arrays: | ||
| Field, StringField and PropertyField | ||
|
|
||
|
|
||
| .. grid-item-card:: DPF collections | ||
| :link: ref_tutorials_language_and_usage | ||
| :link-type: ref | ||
| :text-align: center | ||
|
|
||
| This tutorial shows how to create and work with some DPF collections: | ||
| FieldsContainer, MeshesContainer and ScopingContainer | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 2 | ||
| :hidden: |
31 changes: 31 additions & 0 deletions
31
doc/source/user_guide/tutorials/distributed_files/index.rst
This file contains hidden or 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,31 @@ | ||
| .. _ref_tutorials_distributed_files: | ||
|
|
||
| ============================== | ||
| Post-process distributed files | ||
| ============================== | ||
|
|
||
| These tutorials show how to create workflows on different processes (possibly on different machines) and connect them. | ||
|
|
||
| .. grid:: 1 1 3 3 | ||
| :gutter: 2 | ||
| :padding: 2 | ||
| :margin: 2 | ||
|
|
||
| .. grid-item-card:: Post process data on distributed processes | ||
| :link: ref_tutorials | ||
| :link-type: ref | ||
| :text-align: center | ||
|
|
||
| This tutorial | ||
|
|
||
| .. grid-item-card:: Create a custom workflow on distributed processes | ||
| :link: ref_tutorials | ||
| :link-type: ref | ||
| :text-align: center | ||
|
|
||
| This tutorial | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 2 | ||
| :hidden: | ||
|
|
This file contains hidden or 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,26 @@ | ||
| .. _ref_tutorials_dpf_server: | ||
|
|
||
| ========== | ||
| DPF server | ||
| ========== | ||
|
|
||
| This tutorial explains how to manipulate DPF client-server architecture | ||
|
|
||
| .. grid:: 1 1 3 3 | ||
| :gutter: 2 | ||
| :padding: 2 | ||
| :margin: 2 | ||
|
|
||
| .. grid-item-card:: Switch between local and remote server | ||
| :link: user_guide_server_types | ||
| :link-type: ref | ||
| :text-align: center | ||
|
|
||
| explains how to manipulate DPF client-server architecture | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 2 | ||
| :hidden: | ||
|
|
||
| server_types.rst | ||
|
|
This file contains hidden or 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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -29,52 +29,60 @@ using the :class:`InProcess <ansys.dpf.core.server_types.InProcessServer>` class | |||||
|
|
||||||
| .. rst-class:: sphx-glr-script-out | ||||||
|
|
||||||
| .. code-block:: none | ||||||
|
|
||||||
| <ansys.dpf.core.server_types.InProcessServer object at ...> | ||||||
| .. jupyter-execute:: | ||||||
| :hide-code: | ||||||
|
|
||||||
| from ansys.dpf import core as dpf | ||||||
| local_server = dpf.start_local_server() | ||||||
| local_server | ||||||
|
|
||||||
| This DPF Server can now be used to instantiate models, operators, and more. | ||||||
|
|
||||||
| .. code-block:: | ||||||
|
|
||||||
| # instantiate an operator | ||||||
| local_operator = dpf.operators.results.displacement(server=local_server) | ||||||
|
|
||||||
| # instantiate a model | ||||||
| from ansys.dpf.core import examples | ||||||
| local_model = dpf.Model(examples.find_simple_bar(), server=local_server) | ||||||
|
|
||||||
|
|
||||||
| DPF Server through the network using gRPC | ||||||
| ----------------------------------------- | ||||||
|
|
||||||
| The :class:`GrpcServer <ansys.dpf.core.server_types.GrpcServer>` class is used | ||||||
| to enable gRPC communication: | ||||||
| to enable gRPC communication: | ||||||
|
|
||||||
| .. code-block:: | ||||||
|
|
||||||
| from ansys.dpf import core as dpf | ||||||
| grpc_server_config = dpf.AvailableServerConfigs.GrpcServer | ||||||
| grpc_server = dpf.start_local_server(config=grpc_server_config) | ||||||
| grpc_server | ||||||
|
|
||||||
| .. rst-class:: sphx-glr-script-out | ||||||
|
|
||||||
| .. code-block:: none | ||||||
|
|
||||||
| <ansys.dpf.core.server_types.GrpcServer object at ...> | ||||||
| .. jupyter-execute:: | ||||||
| :hide-code: | ||||||
|
|
||||||
| from ansys.dpf import core as dpf | ||||||
| grpc_server_config = dpf.AvailableServerConfigs.GrpcServer | ||||||
| grpc_server = dpf.start_local_server(config=grpc_server_config) | ||||||
| grpc_server | ||||||
|
||||||
| grpc_server | |
| print(grpc_server) |
42 changes: 42 additions & 0 deletions
42
doc/source/user_guide/tutorials/enriching_dpf_capabilities/index.rst
This file contains hidden or 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,42 @@ | ||
| .. _ref_tutorials_enriching: | ||
|
|
||
| ========================== | ||
| Enriching DPF capabilities | ||
| ========================== | ||
|
|
||
| The available DPF capabilities loaded in a DPF application can be enhanced | ||
| by creating new operator’s libraries. DPF offers multiple development APIs | ||
| depending on your environment. | ||
|
|
||
| These tutorials demonstrate how to develop those plugins for PyDPF-Core (CPython based) | ||
|
|
||
| .. grid:: 1 1 3 3 | ||
| :gutter: 2 | ||
| :padding: 2 | ||
| :margin: 2 | ||
|
|
||
| .. grid-item-card:: Create custom operators and plugins | ||
| :link: ref_tutorials | ||
| :link-type: ref | ||
| :text-align: center | ||
|
|
||
| This tutorial | ||
|
|
||
| .. grid-item-card:: Create a plug-in package with multiple operators | ||
| :link: ref_tutorials | ||
| :link-type: ref | ||
| :text-align: center | ||
|
|
||
| This tutorial | ||
|
|
||
| .. grid-item-card:: Create a plug-in package that has third-party dependencies | ||
| :link: ref_tutorials | ||
| :link-type: ref | ||
| :text-align: center | ||
|
|
||
| This tutorial | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 2 | ||
| :hidden: | ||
|
|
This file contains hidden or 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,28 @@ | ||
| .. _ref_tutorials_export_data: | ||
|
|
||
| =========== | ||
| Export data | ||
| =========== | ||
|
|
||
| Data in DPF can be exported to universal file formats, such as VTK, HDF5, and TXT files. | ||
| You can use it to generate TH-plots, screenshots, and animations or to create custom result | ||
| plots using the `numpy <https://numpy.org/>`_ and `matplotlib <https://matplotlib.org/>`_ packages. | ||
|
|
||
| These tutorials explains how to export data from your manipulations with PyDPF-Core. | ||
|
|
||
| .. grid:: 1 1 3 3 | ||
| :gutter: 2 | ||
| :padding: 2 | ||
| :margin: 2 | ||
|
|
||
| .. grid-item-card:: HDF5 export | ||
| :link: ref_tutorials | ||
| :link-type: ref | ||
| :text-align: center | ||
|
|
||
| This tutorial | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 2 | ||
| :hidden: | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
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.
These need to be calls to

print, otherwise we just get the repr of the Server object, which looks like this: