diff --git a/.codex/skills/audit-pr b/.codex/skills/audit-pr new file mode 120000 index 000000000..55cb0a7a5 --- /dev/null +++ b/.codex/skills/audit-pr @@ -0,0 +1 @@ +/Users/tingsun/conductor/suews/.claude/skills/audit-pr \ No newline at end of file diff --git a/.codex/skills/doc-styler b/.codex/skills/doc-styler new file mode 120000 index 000000000..38d8ea736 --- /dev/null +++ b/.codex/skills/doc-styler @@ -0,0 +1 @@ +/Users/tingsun/conductor/suews/.claude/skills/doc-styler \ No newline at end of file diff --git a/.codex/skills/examine-issue b/.codex/skills/examine-issue new file mode 120000 index 000000000..b18e36047 --- /dev/null +++ b/.codex/skills/examine-issue @@ -0,0 +1 @@ +/Users/tingsun/conductor/suews/.claude/skills/examine-issue \ No newline at end of file diff --git a/.codex/skills/gh-post b/.codex/skills/gh-post new file mode 120000 index 000000000..5c6492aa3 --- /dev/null +++ b/.codex/skills/gh-post @@ -0,0 +1 @@ +/Users/tingsun/conductor/suews/.claude/skills/gh-post \ No newline at end of file diff --git a/.codex/skills/lint-code b/.codex/skills/lint-code new file mode 120000 index 000000000..3391b5ff8 --- /dev/null +++ b/.codex/skills/lint-code @@ -0,0 +1 @@ +/Users/tingsun/conductor/suews/.claude/skills/lint-code \ No newline at end of file diff --git a/.codex/skills/log-changes b/.codex/skills/log-changes new file mode 120000 index 000000000..ce380ea96 --- /dev/null +++ b/.codex/skills/log-changes @@ -0,0 +1 @@ +/Users/tingsun/conductor/suews/.claude/skills/log-changes \ No newline at end of file diff --git a/.codex/skills/prep-release b/.codex/skills/prep-release new file mode 120000 index 000000000..9207e752a --- /dev/null +++ b/.codex/skills/prep-release @@ -0,0 +1 @@ +/Users/tingsun/conductor/suews/.claude/skills/prep-release \ No newline at end of file diff --git a/.codex/skills/setup-dev b/.codex/skills/setup-dev new file mode 120000 index 000000000..403a20d4f --- /dev/null +++ b/.codex/skills/setup-dev @@ -0,0 +1 @@ +/Users/tingsun/conductor/suews/.claude/skills/setup-dev \ No newline at end of file diff --git a/.codex/skills/start-work b/.codex/skills/start-work new file mode 120000 index 000000000..375639b59 --- /dev/null +++ b/.codex/skills/start-work @@ -0,0 +1 @@ +/Users/tingsun/conductor/suews/.claude/skills/start-work \ No newline at end of file diff --git a/.codex/skills/sync-docs b/.codex/skills/sync-docs new file mode 120000 index 000000000..adc5e2e79 --- /dev/null +++ b/.codex/skills/sync-docs @@ -0,0 +1 @@ +/Users/tingsun/conductor/suews/.claude/skills/sync-docs \ No newline at end of file diff --git a/.codex/skills/verify-build b/.codex/skills/verify-build new file mode 120000 index 000000000..b07031569 --- /dev/null +++ b/.codex/skills/verify-build @@ -0,0 +1 @@ +/Users/tingsun/conductor/suews/.claude/skills/verify-build \ No newline at end of file diff --git a/docs/source/api/dts.rst b/docs/source/api/dts.rst new file mode 100644 index 000000000..6e42b291c --- /dev/null +++ b/docs/source/api/dts.rst @@ -0,0 +1,105 @@ +.. _api_dts: + +DTS Interface +============= + +.. currentmodule:: supy.dts + +The DTS (Derived Type Structure) interface provides a direct +Pydantic-to-Fortran execution path for SUEWS. It bypasses the intermediate +``df_state`` conversion layer used by the traditional backend. + +.. note:: + + This page is an advanced API reference for developers and maintainers. + Standard user workflows remain unchanged and require no DTS-specific steps. + +Build Requirements +------------------ + +DTS features are available only in a full DTS build: + +.. code-block:: bash + + make clean && make dev-dts + +Fast builds (``make dev``) do not include DTS type wrappers. + +For most users, DTS is an internal execution detail. The public +``SUEWSSimulation`` workflow remains the recommended interface. + +Main DTS Runners +---------------- + +.. autosummary:: + :toctree: _autosummary + + run_dts + run_dts_multi + +Factory Functions +----------------- + +.. autosummary:: + :toctree: _autosummary + + create_suews_config + create_suews_site + create_suews_state + create_suews_forcing + create_suews_timer + create_output_line + +Population Functions +-------------------- + +.. autosummary:: + :toctree: _autosummary + + populate_config_from_pydantic + populate_site_from_pydantic + populate_state_from_pydantic + populate_forcing_from_row + populate_timer_from_datetime + populate_atmstate + populate_roughnessstate + populate_ohmstate_defaults + populate_storedrainprm + +Extraction Functions +-------------------- + +.. autosummary:: + :toctree: _autosummary + + extract_output_line_to_dict + build_output_dataframe_from_block + build_full_output_dataframe + extract_state_from_dts + +Performance Considerations and Best Practice +-------------------------------------------- + +- Use DTS when your workflow is YAML/Pydantic-centred. +- For multi-grid workloads, set ``n_jobs`` via ``sim.run(backend="dts", n_jobs=...)``. +- Use ``chunk_day`` for long runs to bound memory usage. +- Keep forcing validation and output QA checks identical across backends. + +FAQ +--- + +**Why does DTS fail in a fast build?** + DTS requires type wrappers that are not present in ``make dev`` builds. + +**Can I save DTS runs with ``sim.save()``?** + Not yet. ``sim.save()`` currently requires DataFrame final state from the + traditional backend. + +**How do I continue a DTS run?** + Use ``sim.initial_states_final`` (Pydantic ``InitialStates``) as the state + source for the next run. + +Related Documentation +--------------------- + +- :doc:`simulation` - ``SUEWSSimulation`` API