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 tutorials and update User Guide layout #1749

Closed
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
=============
API reference
=============

.. toctree::
:maxdepth: 2
:caption: API reference

ansys.dpf.core

44 changes: 0 additions & 44 deletions doc/source/concepts/index.rst

This file was deleted.

5 changes: 3 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pyvista
from ansys.dpf.core import __version__, server, server_factory
from ansys.dpf.core.examples import get_example_required_minimum_dpf_version
from ansys_sphinx_theme import pyansys_logo_black, ansys_favicon, get_version_match
from ansys_sphinx_theme import pyansys_logo_light_mode, ansys_favicon, get_version_match

# Manage errors
pyvista.set_error_output_file("errors.txt")
Expand Down Expand Up @@ -74,6 +74,7 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autosummary",
"enum_tools.autoenum",
"nbsphinx",
"sphinx.ext.autosectionlabel",
Expand Down Expand Up @@ -193,7 +194,7 @@ def reset_servers(gallery_conf, fname, when):
# -- Options for HTML output -------------------------------------------------
html_short_title = html_title = "PyDPF-Core"
html_theme = "ansys_sphinx_theme"
html_logo = pyansys_logo_black
html_logo = pyansys_logo_light_mode
Copy link
Contributor

Choose a reason for hiding this comment

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

@luisaFelixSalles why do we need this change? Is it going to work in dark mode?

Copy link
Collaborator Author

@luisaFelixSalles luisaFelixSalles Sep 16, 2024

Choose a reason for hiding this comment

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

The current nav bar looks like this:

image

The logo has a black square background, but we dont see it because the navigation bar also has a black background.:
image

So, I changed the logo for the one with a light back ground, to match the new navigation bar color. It actually doesn't look good in dark mode, I'll look into other projects to see how they do it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Revathyvenugopal162 I would like to ask for your help also in this case:

I tried passing the logo as an html configuration option with:
image

But I get the following error when building the documentation:

image

Do you know if I'm missing other configuration changes in other to solve this problem?

Copy link
Contributor

Choose a reason for hiding this comment

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

This wont work with out new theme. Please add this "logo": "pyansys" in theme options. example PR , ansys/pyansys-geometry@40366c1#diff-d8d3ed25802824d15bf411f8e97416d8fc6f9247e821b0617f2b869dc584b99c

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried this but it gives me the same error.
Is there a way to implement the logo (that respects the light and dark modes) with the new theme?

Copy link
Contributor

@Revathyvenugopal162 Revathyvenugopal162 Sep 17, 2024

Choose a reason for hiding this comment

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

@luisaFelixSalles @PProfizi The logo issue was fixed in 33fade6 and this is the first time we are getting this issue. i will keep track on this and try to fix it in ansys sphinx theme if required. The recommended way is using "logo":"pyansys" in theme options.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you for your help ! 🙂

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
html_logo = pyansys_logo_light_mode

yes you need to remove this line, and then add "logo":"pyansys", in html theme options. That should work

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just test this variation and it still gives me the same error

Copy link
Contributor

Choose a reason for hiding this comment

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

let me try it locally.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, you are correct, and i think it is because of some mismatch in configuration. i can fix with with another workaround and push that changes if its ok for you

html_favicon = ansys_favicon
html_theme_options = {
"github_url": "https://github.com/ansys/pydpf-core",
Expand Down
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,5 @@ To reach the project support team, email `pyansys.core@ansys.com <pyansys.core@a
examples/index
api/index
operator_reference
concepts/index
contributing

File renamed without changes.
11 changes: 0 additions & 11 deletions doc/source/user_guide/how_to.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@
How-tos
~~~~~~~

.. toctree::
:hidden:

plotting.rst
custom_operators.rst
dpf_server.rst
server_types.rst
server_context.rst
xmlfiles.rst


.. card-carousel:: 2

.. card:: Plot
Expand Down
60 changes: 58 additions & 2 deletions doc/source/user_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,35 @@ The goals of this section are to:
- Describe the most-used DPF entities and how they can help you to access and modify solver data.
- Provide simple how-tos for tackling the most common use cases.

Concepts
--------

.. card-carousel:: 2

.. card:: Concepts and terminology
:link: user_guide_concepts
:link-type: ref
:width: 25%
:text-align: center

.. image:: ../images/drawings/book-logo.png

.. card:: Ways of using DPF
:link: user_guide_waysofusing
:link-type: ref
:width: 25%
:text-align: center

.. image:: ../images/drawings/using-dpf.png

.. card:: Using DPF: Step by step
:link: user_guide_stepbystep
:link-type: ref
:width: 25%
:text-align: center

.. image:: ../images/drawings/checklist.png


.. include::
main_entities.rst
Expand All @@ -22,7 +51,34 @@ The goals of this section are to:


Troubleshooting
~~~~~~~~~~~~~~~
---------------

.. toctree::
troubleshooting
:maxdepth: 2
:hidden:
:caption: Concepts

concepts.rst
waysofusing.rst
stepbystep.rst

.. toctree::
:maxdepth: 2
:hidden:
:caption: Tutorials

model
operators
fields_container
plotting
custom_operators
server_context
server_types
xmlfiles

.. toctree::
:maxdepth: 2
:hidden:
:caption: Troubleshooting

troubleshooting
23 changes: 11 additions & 12 deletions doc/source/user_guide/main_entities.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
.. _ref_main_entities:

DPF most-used entities
~~~~~~~~~~~~~~~~~~~~~~
Tutorials
---------

.. toctree::
:hidden:
The following tutorials shows in details how to use basic features of PyDPF-Core
for each usage main step.
luisaFelixSalles marked this conversation as resolved.
Show resolved Hide resolved

model
operators
fields_container
Define simulation data
luisaFelixSalles marked this conversation as resolved.
Show resolved Hide resolved
~~~~~~~~~~~~~~~~~~~~~~

.. card-carousel:: 2

Expand All @@ -18,24 +17,24 @@ DPF most-used entities
:width: 25%
:text-align: center

.. image:: ../images/drawings/model.png
.. card:: DPF model
:link: user_guide_model
:link-type: ref
:width: 25%
:text-align: center

.. card:: Fields container and fields
:link: ref_user_guide_fields_container
:link-type: ref
:width: 25%
:text-align: center

.. image:: ../images/drawings/field.png

.. card:: Operators
:link: ref_user_guide_operators
:link-type: ref
:width: 25%
:text-align: center

.. image:: ../images/drawings/small_operator.svg




Expand Down
2 changes: 2 additions & 0 deletions examples/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
Examples
========
These examples demonstrate the behavior and usage of DPF-Core.


7 changes: 4 additions & 3 deletions requirements/requirements_docs.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ansys_sphinx_theme==0.16.5
enum-tools[sphinx]==0.12.0
graphviz==0.20.1
imageio==2.34.1
Expand All @@ -10,8 +9,10 @@ pyvista==0.44.1
sphinx==7.1.0
sphinx-autobuild==2024.2.4
sphinx-copybutton==0.5.2
sphinx-gallery==0.17.0
sphinx-gallery==0.17.1
sphinx-notfound-page==1.0.0
sphinx-reredirects==0.1.3
sphinx_design==0.6.0
sphinx_design==0.6.1
sphinxcontrib-napoleon==0.7
ansys-sphinx-theme[autoapi]==1.0.8
numpydoc==1.8.0
Loading