Skip to content
Open
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
409 changes: 302 additions & 107 deletions dft_organizer/aiida/reporting.py

Large diffs are not rendered by default.

44 changes: 33 additions & 11 deletions dft_organizer/cli/report_aiida_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,74 @@

@click.command()
@click.option(
"--label",
type=str,
default=None,
help="Filter by calculation label (exact match)."
"--label", type=str, default=None, help="Filter by calculation label (exact match)."
)
@click.option(
"--output-dir",
default="/tmp",
type=click.Path(file_okay=False),
show_default=True,
help="Directory where reports will be saved."
help="Directory where reports will be saved.",
)
@click.option(
"--from-date",
type=str,
default=None,
metavar="YYYY-MM-DD",
help="Only include calculations created on or after this date."
help="Only include calculations created on or after this date.",
)
@click.option(
"--to-date",
type=str,
default=None,
metavar="YYYY-MM-DD",
help="Only include calculations created on or before this date."
help="Only include calculations created on or before this date.",
)
@click.option(
"--skip-errors",
is_flag=True,
default=False,
help="Skip calculations that finished with errors (exit_status != 0)."
help="Skip calculations that finished with errors (exit_status != 0).",
)
@click.option(
"--provider",
type=click.Choice(["hetzner", "vultr_usa"], case_sensitive=False),
default=None,
help="Override cloud provider for cost calculation (default: auto-detect from computer name).",
)
@click.option(
"--engine",
type=click.Choice(["crystal", "fleur"], case_sensitive=False),
default=None,
help="Filter by calculation engine (crystal/fleur). Skips expensive FLEUR enrichment when filtering to crystal only.",
)
@click.option(
"--machine-type",
type=str,
default=None,
help="Override machine type (cloud plan, e.g. vbm-24c-256gb-amd) for cost calculation. "
"Default: read from /etc/yascheduler/yascheduler.conf.",
)
def cli(label, output_dir, from_date, to_date, skip_errors):
def cli(
label, output_dir, from_date, to_date, skip_errors, provider, engine, machine_type
):
"""
Generate summary CSV, JSON, and error report from AiiDA database.

Queries AiiDA CalcJobNodes and produces a report with uuid, label,
engine, formula, space group, cost, exit status, and other metadata.
No archives are created — this is a reporting-only command.
engine, formula, space group, cost (with currency, EUR/USD), exit
status, and other metadata. No archives are created — this is a
reporting-only command.
"""
generate_aiida_reports(
label=label,
from_date=from_date,
to_date=to_date,
skip_errors=skip_errors,
output_dir=output_dir,
provider=provider,
engine=engine,
machine_type=machine_type,
)


Expand Down
26 changes: 24 additions & 2 deletions dft_organizer/cli/report_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,28 @@
metavar="YYYY-MM-DD",
help="Only include calculations modified on or after this date.",
)

def cli(path: str, aiida: bool, skip_errors: bool, output_dir: str | None, from_date: str | None) -> None:
@click.option(
"--provider",
type=click.Choice(["hetzner", "vultr_usa"], case_sensitive=False),
default=None,
help="Override cloud provider for cost calculation (default: auto-detect from computer name).",
)
@click.option(
"--machine-type",
type=str,
default=None,
help="Override machine type (cloud plan, e.g. vbm-24c-256gb-amd) for cost calculation. "
"Default: read from /etc/yascheduler/yascheduler.conf.",
)
def cli(
path: str,
aiida: bool,
skip_errors: bool,
output_dir: str | None,
from_date: str | None,
provider: str | None,
machine_type: str | None,
) -> None:
"""
Generate summary CSV and error reports without archiving.
"""
Expand All @@ -46,6 +66,8 @@ def cli(path: str, aiida: bool, skip_errors: bool, output_dir: str | None, from_
skip_errors=skip_errors,
output_dir=Path(output_dir) if output_dir else None,
from_date=from_date,
provider=provider,
machine_type=machine_type,
)


Expand Down
Loading