Skip to content

Commit

Permalink
added materials to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jmeneghini committed Dec 27, 2023
1 parent 647f3b0 commit 8647e19
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 249 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
run: sudo apt install sqlite3 libsqlite3-dev python3-pip

- name: Install Python packages
run: sudo pip3 install pandas
run: sudo pip3 install pandas tabulate

- name: Generate Materials HTML
run: sudo mkdir ./docs/html && sudo python3 ./docs/gen_materials_page.py
run: sudo python3 ./docs/additional_docs/gen_materials_page.py

- name: Doxygen Action
uses: mattnotmitt/[email protected]
Expand Down
5 changes: 3 additions & 2 deletions docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ FILE_VERSION_FILTER =
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.

LAYOUT_FILE = ./docs/layout.xml
LAYOUT_FILE =

# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
Expand Down Expand Up @@ -865,7 +865,8 @@ WARN_LOGFILE =
# Note: If this tag is empty the current directory is searched.

INPUT = ./include \
./README.md
./README.md \
./docs/additional_docs

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down
28 changes: 28 additions & 0 deletions docs/additional_docs/gen_materials_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import sqlite3
import pandas as pd
import os

# Change working directory to the directory of this file
os.chdir(os.path.dirname(os.path.abspath(__file__)))

db_path = '../../data/data_sources/EPDL/EPDL.db'
conn = sqlite3.connect(db_path)
c = conn.cursor()

# Export Materials table to pandas dataframe
df = pd.read_sql_query("SELECT * FROM Materials", conn)

# Add units to density column name
df.rename(columns={'Density': 'Density (g/cm3)'}, inplace=True)

# Export df to markdown
df.to_markdown('Materials.md', index=False)

header = "# Materials Available For Simulation"

# Add header to markdown file
with open('Materials.md', 'r+') as f:
content = f.read()
f.seek(0, 0)
f.write(header + '\n' + content)

16 changes: 0 additions & 16 deletions docs/gen_materials_page.py

This file was deleted.

229 changes: 0 additions & 229 deletions docs/layout.xml

This file was deleted.

0 comments on commit 8647e19

Please sign in to comment.