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

Add import data tutorials to the main tutorials section #1933

Open
wants to merge 17 commits into
base: doc/new-tutorials-section
Choose a base branch
from

Conversation

luisaFelixSalles
Copy link
Collaborator

Add the import data tutorials

List of tutorials:

  • Manual input data on DPF
  • Import a result file in DPF
  • Extract and explore results metadata
  • Extract and explore results data
  • Narrow down data

Preview on how it renders

Import data section main page

image

Manual input data on DPF

_D__ANSYSdev_pydpf-core_doc_build_html_user_guide_tutorials_import_data_represent_data_on_dpf html

Import a result file in DPF

_D__ANSYSdev_pydpf-core_doc_build_html_user_guide_tutorials_import_data_import_result_file html (1)

Extract and explore results metadata

_D__ANSYSdev_pydpf-core_doc_build_html_user_guide_tutorials_import_data_extract_and_explore_results_metadata html

Extract and explore results data

_D__ANSYSdev_pydpf-core_doc_build_html_user_guide_tutorials_import_data_extract_and_explore_results_data html

Narrow down data

_D__ANSYSdev_pydpf-core_doc_build_html_user_guide_tutorials_import_data_narrow_down_data html

@luisaFelixSalles luisaFelixSalles added the tutorials Related to PyDPF-Core tutorials label Nov 25, 2024
@luisaFelixSalles luisaFelixSalles self-assigned this Nov 25, 2024
Copy link

codecov bot commented Nov 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.98%. Comparing base (97f32dc) to head (2e1c8d9).
Report is 57 commits behind head on doc/new-tutorials-section.

Additional details and impacted files
@@                      Coverage Diff                      @@
##           doc/new-tutorials-section    #1933      +/-   ##
=============================================================
- Coverage                      88.02%   86.98%   -1.05%     
=============================================================
  Files                             83       83              
  Lines                           9963     9973      +10     
=============================================================
- Hits                            8770     8675      -95     
- Misses                          1193     1298     +105     
---- 🚨 Try these New Features:

@@ -15,19 +15,12 @@ From user input
:padding: 2
:margin: 2

.. grid-item-card:: Import data from csv file
:link: ref_tutorials
.. grid-item-card:: Manual input data on DPF
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.. grid-item-card:: Manual input data on DPF
.. grid-item-card:: Use custom data

:text-align: center

Learn how to represent your manual input data in a DPF data storage structure
Learn how to represent your manual input data in a DPF data storage structures
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Learn how to represent your manual input data in a DPF data storage structures
Learn how to build DPF data storage structures from custom data

@@ -0,0 +1,103 @@
.. _ref_tutorials_represent_data_on_dpf:
Copy link
Contributor

@PProfizi PProfizi Nov 26, 2024

Choose a reason for hiding this comment

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

Suggested change
.. _ref_tutorials_represent_data_on_dpf:
.. _ref_tutorials_field_with_custom_data:

.. grid-item-card:: Import data from csv file
:link: ref_tutorials
.. grid-item-card:: Manual input data on DPF
:link: ref_tutorials_represent_data_on_dpf
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
:link: ref_tutorials_represent_data_on_dpf
:link: ref_tutorials_field_with_custom_data

Comment on lines +3 to +5
========================
Manual input data on DPF
========================
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
========================
Manual input data on DPF
========================
=======================
Load custom data in DPF
=======================

.. |data| replace:: :attr:`Field.data<ansys.dpf.core.field_base._FieldBase.data>`
.. |scoping| replace:: :attr:`Field.scoping<ansys.dpf.core.field_base._FieldBase.scoping>`

This tutorial shows how to represent your manual input data in a DPF data storage structures.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This tutorial shows how to represent your manual input data in a DPF data storage structures.
This tutorial shows how to represent your custom data in DPF data storage structures.

Comment on lines +15 to +20
When handling data DPF uses |FieldsContainer| and |Field| to store and return it. The |Field| is a DPF array
and a collection of |Field| is called |FieldsContainer|. For more information on how the data is structure
in a |Field| and how the DPF data storage structures works check the :ref:`ref_tutorials_data_structures`
tutorial section.

Here we will create some 3d vector |Field|, where the data comes from lists.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
When handling data DPF uses |FieldsContainer| and |Field| to store and return it. The |Field| is a DPF array
and a collection of |Field| is called |FieldsContainer|. For more information on how the data is structure
in a |Field| and how the DPF data storage structures works check the :ref:`ref_tutorials_data_structures`
tutorial section.
Here we will create some 3d vector |Field|, where the data comes from lists.
DPF uses |Field| and |FieldsContainer| objects to handle data. The |Field| is a homogeneous array
and a |FieldsContainer| is a labeled collection of |Field|.
For more information on DPF data structures such as the |Field| and their use check the :ref:`ref_tutorials_data_structures` tutorials section.
Here we show how to create a 3d vector |Field| from data stored in Python lists.

We need a part on how to do that with numpy arrays.

Defining the fields
-------------------

To manually import data on DPF you have to create the structure to store it.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To manually import data on DPF you have to create the structure to store it.
To import custom data into DPF you first have to create the structure to store it.

Comment on lines +22 to +23
Defining the fields
-------------------
Copy link
Contributor

@PProfizi PProfizi Nov 26, 2024

Choose a reason for hiding this comment

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

Suggested change
Defining the fields
-------------------
Create DPF fields
-----------------

Copy link
Contributor

@PProfizi PProfizi Nov 26, 2024

Choose a reason for hiding this comment

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

@luisaFelixSalles I would personally use five sections for this tutorial:

  • a first section where we just define the custom data used later
  • a second section on how to create a field -> we need to show more here on how to set the proper nature, size and dimensionality. This is crucial to properly set the data later so even if it is already in another tutorial I would still explain the basics here. Also show the field_factory, the fact you can create unitary fields, fields with a given value everywhere, etc. With have helpers so should mention them here.
  • a third section where we show how to set data arrays directly, and how to set the scoping for that array
    This is the most important as people rarely only add three data points. There are steps missing in this third section however on setting the data property. The scoping is undefined in this case, so it needs to also be built and set.
  • a fourth section where we show how to append data or change data for a specific entity id
  • a final section on how to create the fields_container based on the fields as you showed with the helper. Mention the fields_container factory etc, without going into too much detail if there is another tutorial for that. To me this is a last step as not everyone will need to create a collection for the fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tutorials Related to PyDPF-Core tutorials
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants