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

fix domain list #12

Merged
merged 3 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 3 additions & 4 deletions .github/workflows/build-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ jobs:
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV

- name: Create conda environment
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
cache-downloads: true
cache-downloads-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
micromamba-version: 'latest'
cache-downloads-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}"
environment-file: archive-specifications/environment.yml
extra-specs: |
create-args: >-
python=${{ matrix.python-version }}

- name: Version info
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ jobs:
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV

- name: Create conda environment
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
cache-downloads: true
cache-downloads-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
micromamba-version: 'latest'
cache-downloads-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}"
environment-file: archive-specifications/environment.yml
extra-specs: |
create-args: >-
python=${{ matrix.python-version }}

- name: Version info
Expand Down
26 changes: 22 additions & 4 deletions scripts/create-domain-plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ def create_subsection(domain_id, fmt):
return text


def create_domain_section(template, fmt):
def create_domain_section(template, fmt, domain_ids):
text = "## Overview\n\n"
table = getattr(df.reset_index(), f"to_{fmt}")(index=False)
text += f"{table}\n\n"
text += "\n".join(create_subsection(d, fmt) for d in df.index)
text += "\n".join(create_subsection(d, fmt) for d in domain_ids)
with open(template, "r") as f:
tpl = f.read()
with open(op.join(bookpath, "domains.md"), "w") as f:
Expand All @@ -154,8 +154,26 @@ def create_domain_section(template, fmt):
except Exception:
fmt = "html"

for domain_id in df.index:
domain_ids = [
"SAM-50",
"CAM-50",
"NAM-50",
"EUR-50",
"AFR-50",
"WAS-50",
"EAS-50",
"CAS-50",
"AUS-50",
"ANT-50",
"ARC-50",
"MED-50",
"MNA-50",
]

for domain_id in domain_ids:
print(domain_id)
plot_domain(domain_id)

create_domain_section(template=op.join(bookpath, "domains.tpl"), fmt=fmt)
create_domain_section(
template=op.join(bookpath, "domains.tpl"), fmt=fmt, domain_ids=domain_ids
)