Skip to content

Conversation

ahnaf-tahmid-chowdhury
Copy link
Member

Description

This PR introduces a comprehensive documentation setup for PyDAGMC using Sphinx.

Key changes:

  • Configured Sphinx with Myst-parser for Markdown support and sphinx-book-theme.
  • Added necessary documentation dependencies (sphinx, sphinx-book-theme, myst-parser, nbsphinx, etc.) to pyproject.toml.
  • Created initial page structure:
    • User Guide
    • Tutorial
    • Methodology
    • API Reference (autodoc for pydagmc.dagnav)
    • Getting Help
  • Updated README.md to reflect new documentation and add a link.
  • Configured conf.py for theme, extensions, and autodoc settings.

Live demo: https://ahnaf-tahmid-chowdhury.github.io/pydagmc/

Copy link

codecov bot commented Jun 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@1af3754). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #48   +/-   ##
=======================================
  Coverage        ?   97.19%           
=======================================
  Files           ?        2           
  Lines           ?      428           
  Branches        ?       47           
=======================================
  Hits            ?      416           
  Misses          ?        9           
  Partials        ?        3           
Flag Coverage Δ
unittests 97.19% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@pshriwise pshriwise left a comment

Choose a reason for hiding this comment

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

Initial review here. Overall, I think this looks quite good. It's much appreciated @ahnaf-tahmid-chowdhury!


At the core, DAGMC geometry is organized using MOAB **Entity Sets**. These are collections of other entities, which can include mesh elements (like triangles) or other entity sets, forming a hierarchical structure. PyDAGMC maps these entity sets to its `Group`, `Volume`, and `Surface` classes.

### Essential MOAB Tags Used by DAGMC
Copy link
Member

Choose a reason for hiding this comment

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

Haven't fully parsed it yet, but I do like this summary. I think it would be better placed in a section on the DAGMC file data model rather than methodology.

Copy link
Member Author

Choose a reason for hiding this comment

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

created new file called data-model and moved the contents there

Copy link
Member

Choose a reason for hiding this comment

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

I don't see that file in this PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Recently merged it back into the methodology file with a dedicated section.

* **Volumes and Surfaces:** A `Volume` entity set typically contains `Surface` entity sets that form its boundary. PyDAGMC uses `mb.get_child_meshsets(volume_handle)` to find a `Volume`'s surfaces and `mb.get_parent_meshsets(surface_handle)` to find a `Surface`'s parent volumes.
* **Groups and Volumes/Surfaces:** A `Group` entity set contains `Volume` and/or `Surface` entity sets. PyDAGMC uses `mb.get_entities_by_type_and_tag` within the group's handle to find its constituent volumes and surfaces.

## PyDAGMC Class Structure
Copy link
Member

Choose a reason for hiding this comment

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

In contrast to the "EntitySets", " Essemtial MOAB Tags...", and "Implicit Relationships...", sections above, the content in this section seems appropriate for methodology. Let's relocate the other sections.

* Then, the specific class (e.g., `Volume`) is instantiated with this configured handle.
* An ID is assigned, either user-provided or auto-generated to be unique within the model for that entity type.

* **Volume Calculation (`Volume.volume`):**
Copy link
Member

@pshriwise pshriwise Jul 5, 2025

Choose a reason for hiding this comment

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

Note to myself to review the rendered version of this equation.

ahnaf-tahmid-chowdhury and others added 7 commits August 3, 2025 23:23
Co-authored-by: Patrick Shriwise <pshriwise@gmail.com>
Co-authored-by: Patrick Shriwise <pshriwise@gmail.com>
Co-authored-by: Patrick Shriwise <pshriwise@gmail.com>
Co-authored-by: Patrick Shriwise <pshriwise@gmail.com>
The 'EntitySets', 'Essential MOAB Tags', and 'Implicit Relationships' sections were moved from the methodology page to a new data-model page to improve the documentation's structure.

A link to the new page has been added to the table of contents.
…ture

- Updated the title and introductory text in the tutorial to enhance engagement and clarity.
- Improved the organization of the tutorial sections, emphasizing key functionalities of PyDAGMC.
- Added a new section in the tutorial detailing the internal operations of PyDAGMC, providing insights into model loading, entity access, triangle data handling, material assignment, entity creation, and volume calculation.
@ahnaf-tahmid-chowdhury
Copy link
Member Author

@pshriwise I think you are suggesting removing the PyDAGMC Class Structure section from the methodology and keeping DAGMC Data Model there. If that’s correct, please let me know and I’ll update it accordingly.

Comment on lines 18 to 20
F ==> G["Build Implicit Relationships"]
G ==> H["Enable Queries"]
H ==> I["Extract Geometry"]
Copy link
Member

Choose a reason for hiding this comment

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

A lot of this is done as part of MOAB. I don't think it's important to break down a file load in this kind of detail here. Mainly what users will be interested in (in my opinion) is what they can do with a file once loaded. In short, an additional sentence above to capture all of this should suffice. something like:

"When a file is loaded, its embedded geometric topology relationships and metadata (material/property assignments) are loaded according to the conventions established by the DAGMC library."

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

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

I made a few suggestions here, but it looks like we're waiting on responses to other review comments still.


PyDAGMC is a Python interface for interacting with DAGMC .h5m files through the embedded topological relationships and metadata contained within. These interactions occur through a set of Python classes corresponding to DAGMC’s metadata Group (a grouping of volumes or surfaces), Volume, and Surface groupings in the mesh database. This interface is intended to provide a simple interface for obtaining information about DAGMC models, replacing significant boilerplate code required to perform the same queries with PyMOAB, the Python interface for MOAB itself.

PyDAGMC classes provide the ability to perform basic queries as properties of the class instances. These queries include:
Copy link
Member

Choose a reason for hiding this comment

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

I think many users like to see some basic documentation like this in the README on GH so they don't have to dive into a complete documentation page. I think it would be good to leave this here, but move the link to detailed documentation before this.


project = 'PyDAGMC'
copyright = '2023 - {}, The UW CNERG Team. All rights reserved'.format(datetime.date.today().year)
author = 'Patrick Shriwise, Paul Wilson, et al'
Copy link
Member

Choose a reason for hiding this comment

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

There are other authors who deserve more recognition than me (e.g. Romano, Peterson). We should either be comprehensive or find another way to list authors here.

pyproject.toml Outdated
Comment on lines 33 to 35
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Copy link
Member

Choose a reason for hiding this comment

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

Should we get rid of some of these old versions?

@@ -0,0 +1,52 @@
# Welcome to PyDAGMC

PyDAGMC is a Python interface for interacting with DAGMC `.h5m` files
Copy link
Member

Choose a reason for hiding this comment

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

Can we link the word "DAGMC" to the DAGMC documentation (such as it is) here and throughout?


# Methodology

PyDAGMC provides a Pythonic abstraction layer over PyMOAB for interacting with DAGMC (Direct Accelerated Geometry Monte Carlo) `.h5m` files. This section delves into the underlying concepts, data structures, and design choices that enable PyDAGMC's functionality.
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should include a statement about what a DAGMC file actually is? Something like:

A DAGMC file contains a surface mesh representation of a geometry, including 
metadata to define the topological relationships of that geometry and material
assignments, using MOAB's mesh file conventions.  The metadata conventions are 
specific to DAGMC.

We do get into it more in the details below, but perhaps some early statement like this is helpful context and provides some useful vocabulary and semantic nuance.


At the core, DAGMC geometry is organized using MOAB **Entity Sets**. These are collections of other entities, which can include mesh elements (like triangles) or other entity sets, forming a hierarchical structure. PyDAGMC maps these entity sets to its `Group`, `Volume`, and `Surface` classes.

### Essential MOAB Tags Used by DAGMC
Copy link
Member

Choose a reason for hiding this comment

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

I don't see that file in this PR?

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

Successfully merging this pull request may close these issues.

3 participants