Skip to content

Commit

Permalink
Merge pull request #329 from fusion-energy/fixing-ci-2
Browse files Browse the repository at this point in the history
not importing uninstalled package
  • Loading branch information
shimwell authored Sep 26, 2024
2 parents e16118e + 8ac9e5d commit 3cfa8d2
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/documentation_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build
publish_dir: _build/docs
# with next rlease of actions-gh-pages
# issue to allow force_orphan will be fixed
# https://github.com/peaceiris/actions-gh-pages/issues/455
Expand Down
26 changes: 26 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,32 @@ In all cases it is possible to add additional components such as divertors, polo
The reactors can be varied in terms of their radial build, vertical build, elongation and triangularity which gives a lot of variability.
These examples show how to make various reactors with and without different components, each example is minimal and aims to show a single feature, you will have to combine examples to make a complete model.


Visualization options
=====================

The reactors (cadquery.Assembly objects) and components (cadquery.Workplane objects) can be visualized in a number of ways.
First option is to export them to STEP, BREP or STL file then open the file with your favorite CAD software for example `FreeCAD <https://www.freecad.org/>`_.
See the `CadQuery documentation on saving <https://cadquery.readthedocs.io/en/latest/importexport.html#exporting-step>`_ for more information.
Other options include the built in visualization tools in CadQuery

.. code-block:: python
from cadquery.vis import show
show(result) # where result is the returned reactor or component object
or the jupyter_cadquery package which allows for interactive 3D visualization in a web browser.
or the jupyter_cadquery package which allows for interactive 3D visualization in a web browser.

.. code-block:: python
# pip install jupyter_cadquery
# might needed to downgrade pip with ... python -m pip install pip==24.0
from jupyter_cadquery import show
view = show(result) # where result is the returned reactor or component object
view.export_html("3d.html")
Tokamak from plasma
-------------------

Expand Down
4 changes: 0 additions & 4 deletions examples/spherical_tokamak_from_plasma_minimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
)
my_reactor.save(f"spherical_tokamak_from_plasma_minimal.step")

# needed to downgrade pip with ... python -m pip install pip==24.0
# from jupyter_cadquery import show
# view = show(my_reactor)
# view.export_html('3d.html')


# my_model = CadToDagmc()
Expand Down
5 changes: 0 additions & 5 deletions examples/spherical_tokamak_from_plasma_with_divertor.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
my_reactor.save("spherical_tokamak_from_plasma_with_divertor.step")
print('written spherical_tokamak_from_plasma_with_divertor.step')

# needed to downgrade pip with ... python -m pip install pip==24.0
# from jupyter_cadquery import show
# view = show(my_reactor)
# view.export_html("3d.html")


# my_model = CadToDagmc()
# material_tags = ["mat1"] * 21 # the two divertors split the 3 blanket layers into 9 and the magnets also splt the blanket.
Expand Down
5 changes: 0 additions & 5 deletions examples/spherical_tokamak_from_plasma_with_pf_magnets.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@
)
my_reactor.save(f"spherical_tokamak_from_plasma_with_pf_magnets.step")

# needed to downgrade pip with ... python -m pip install pip==24.0
# from jupyter_cadquery import show
# view = show(my_reactor)
# view.export_html('spherical_tokamak_from_plasma.html')


# my_model = CadToDagmc()
# material_tags = ["mat1"] * 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@
)
my_reactor.save(f"spherical_tokamak_from_plasma_with_pf_magnets_and_divertor.step")

# needed to downgrade pip with ... python -m pip install pip==24.0
# from jupyter_cadquery import show
# view = show(my_reactor)
# view.export_html('3d.html')


# my_model = CadToDagmc()
Expand Down
8 changes: 0 additions & 8 deletions examples/spherical_tokamak_from_plasma_with_tf_magnets.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@

result.save(f"spherical_tokamak_minimal.step")


# needed to downgrade pip with ... python -m pip install pip==24.0
from jupyter_cadquery import show

view = show(result)
view.export_html("3d.html")


my_model = CadToDagmc()
material_tags = ["mat1"] * 7
my_model.add_cadquery_object(cadquery_object=result, material_tags=material_tags)
Expand Down
6 changes: 0 additions & 6 deletions examples/spherical_tokamak_minimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@
)
my_reactor.save(f"spherical_tokamak_minimal.step")

# needed to downgrade pip with ... python -m pip install pip==24.0
from jupyter_cadquery import show

view = show(my_reactor)
view.export_html("3d.html")


my_model = CadToDagmc()
material_tags = ["mat1"] * 6
Expand Down
3 changes: 0 additions & 3 deletions examples/tokamak_with_pf_magnets.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@
add_extra_cut_shapes=add_extra_cut_shapes,
)

from cadquery.vis import show
show(my_reactor)

my_reactor.save(f"tokamak_minimal.step")
print(f"Saved as tokamak_minimal.step")

Expand Down

0 comments on commit 3cfa8d2

Please sign in to comment.