The shared long-lived branch for aggregating new tests is named tests-collection. Create it locally with git branch tests-collection (already created in this repo) and keep it rebased onto main so follow-up PRs can target it directly.
:::task-stub{title="Inventory ryan_library.functions for test planning"}
- Catalogue every top-level module under
ryan_library/functions(including subpackages such aspandas,gdal,tuflow, andRORB) and note their primary responsibilities. - Identify critical functions, IO operations, and dependency boundaries that require regression coverage, distinguishing between pure utilities and wrappers around external tools.
- Produce a testing priorities matrix (e.g., high/medium/low) referencing current usage in
ryan-scriptsto inform which modules should receive tests first. - Summarise fixtures, mocks, and external resources each module would need for feasible unit testing, highlighting any blockers or data dependencies. :::
The following tasks aim to systematise backlog generation by first discovering every Python source file, correlating it with existing tests, and then spawning follow-up tasks for gaps. Contributors should prefer scripting repeatable inventories over manual spot-checks so the resulting backlog scales to hundreds of actionable work items.
:::task-stub{title="Produce source-to-test coverage matrix"}
- Write a lightweight discovery script (e.g., Python +
pathlib) that enumerates every.pyfile underryan_library,ryan-scripts, andrepo-scripts, skipping known vendored or legacy paths (vendor/,ryan-functions/,unsorted/). - For each source file, detect whether a corresponding test module already exists (e.g., by mirroring the path under
tests/or grepping for imports) and record the linkage in a CSV/Markdown table. - Surface the inventory in
TESTING_TASKS.md(or a linked document) with columns for "Has tests?", "Priority", and "Notes" so future backlog tasks can be generated programmatically. - Automate a weekly refresh of this matrix (documenting the command in the repo-scripts folder) to keep the backlog aligned with code churn. :::
:::task-stub{title="Generate backlog entries for uncovered files"}
- Consume the coverage matrix above to identify every source file lacking an associated test module.
- For each uncovered file, create a dedicated
task-stubdescribing the scope of tests required (unit, integration, smoke) and any fixtures or external dependencies that must be mocked. - Group the generated tasks by package/feature area, ensuring large modules are further decomposed into per-function subtasks to keep individual assignments manageable.
- Embed the resulting backlog into
TESTING_TASKS.md, targeting at least 50 new task entries in the first pass and documenting the script/command used to regenerate them. :::
:::task-stub{title="Cross-check backlog against pytest coverage reports"}
- Configure
pytest --covto run selectively on modules with existing tests, capturing coverage data without executing unready suites (respect exclusions such asryan_library/processors). - Parse the resulting coverage XML/JSON to flag functions or branches still untested despite having nominal test modules.
- Feed those findings back into the backlog by appending gap-specific subtasks (e.g., "Add branch coverage for error handling in X") beneath the relevant module headings.
- Document the coverage workflow (commands, expected runtime, environment prerequisites) so future contributors can routinely validate backlog completeness. :::
The following meta-tasks focus on exploding the testing backlog by breaking down each module into granular work items. Each assignee should generate numerous downstream task-stubs (aim for at least one per public function or behavioural pathway) rather than implementing tests directly.
:::task-stub{title="Generate detailed backlog for data_processing helpers"}
- Review every callable in
ryan_library/functions/data_processing.py, noting pure utilities versus IO-heavy helpers. - For each behaviour (success path, exception handling, logging side effects), draft discrete
task-stubs describing the exact unit tests required. - Document fixture and monkeypatch requirements (e.g., fake iterables, exception-raising callables) within those new tasks.
- Collate the generated tasks under a dedicated subsection in
TESTING_TASKS.mdfor easy tracking. :::
:::task-stub{title="Break down dataframe_helpers into per-function test tasks"}
- Catalogue the DataFrame manipulation utilities exposed in
ryan_library/functions/dataframe_helpers.py. - Produce separate task entries for validation, aggregation, and cleanup routines, ensuring edge cases (empty frames, mismatched schemas, dtype coercion) are explicitly called out.
- Specify pandas fixtures or sample CSV inputs each future test will need.
- Insert the resulting tasks into
TESTING_TASKS.md, grouped beneath a new dataframe_helpers heading. :::
:::task-stub{title="Explode file_utils coverage requirements"}
- Map every function in
ryan_library/functions/file_utils.py, including internal helpers that manage concurrency, logging, and filesystem safeguards. - For each major branch (e.g., queue worker lifecycle, logging paths, UNC path handling), author individual
task-stubs detailing the necessary test cases and expected fixtures/mocks. - Ensure the generated tasks distinguish between fast unit tests and slower integration-style checks so they can be scheduled appropriately.
- Append the backlog to
TESTING_TASKS.md, targeting at least 10 downstream tasks for this module. :::
:::task-stub{title="Plan logging_helpers formatter/regression tests"}
- Audit
ryan_library/functions/logging_helpers.pyto identify formatters, handlers, and utilities needing verification. - Draft dedicated tasks for each public helper, covering both nominal logging flow and attribute-driven switches (e.g.,
ConditionalFormatter). - Document logging fixture needs (e.g.,
caplog, fakeLogRecordinstances) within each new task. - Capture the backlog beneath a fresh logging_helpers section in
TESTING_TASKS.md. :::
:::task-stub{title="Enumerate loguru_helpers testing surfaces"}
- Inspect
ryan_library/functions/loguru_helpers.py, categorising wrappers, configuration helpers, and sink management logic. - Create targeted tasks for each behaviour, including error propagation, default configuration, and interaction with external loguru sinks.
- Note any third-party dependencies or monkeypatch requirements per task.
- Publish the resulting tasks inside
TESTING_TASKS.mdalongside links to supporting documentation where relevant. :::
:::task-stub{title="Design misc_functions testing backlog"}
- List every helper inside
ryan_library/functions/misc_functions.py, grouping related utilities (math helpers, string parsing, concurrency heuristics). - Generate a suite of new tasks, each focusing on a single function or closely-related group, emphasising edge cases and documented behaviour.
- Identify any platform-specific considerations (Windows/Linux) and record them in the spawned tasks.
- Organise the backlog additions beneath a misc_functions heading in
TESTING_TASKS.md. :::
:::task-stub{title="Scope parse_tlf parsing/regression tasks"}
- Review
ryan_library/functions/parse_tlf.pyto understand the parsing pipeline and supported file formats. - Produce tasks covering happy paths, malformed input handling, and logging/reporting branches.
- Describe required sample fixtures (e.g., representative
.tlfsnippets) within each new task. - Add the backlog entries under a parse_tlf subsection in
TESTING_TASKS.md. :::
:::task-stub{title="Plan path_stuff normalisation test tasks"}
- Analyse
ryan_library/functions/path_stuff.pyfor path conversions, relative path checks, and network drive handling. - Create granular tasks that cover Windows vs. POSIX expectations, error handling, and mapping overrides.
- Highlight monkeypatch requirements (e.g.,
Path.cwd, custom network mapping) in each new task. - Record the generated backlog beneath a path_stuff heading in
TESTING_TASKS.md. :::
:::task-stub{title="Derive process_12D_culverts test backlog"}
- Examine
ryan_library/functions/process_12D_culverts.pyto understand data inputs, file outputs, and dependency graph. - Draft tasks for each processing stage, from input validation to final output generation, specifying mocks for external tools where needed.
- Include negative path considerations (missing files, invalid schema) when creating each task.
- Append the tasks to
TESTING_TASKS.mdunder a dedicated process_12D_culverts section. :::
:::task-stub{title="Outline terrain_processing regression tasks"}
- Review algorithms inside
ryan_library/functions/terrain_processing.py, distinguishing pure calculations from GDAL/NumPy integrations. - Generate tasks targeting each computational branch, ensuring numerical stability, coordinate handling, and error reporting are covered.
- Specify required raster/vector fixtures or synthetic datasets per task.
- Publish the backlog under a terrain_processing heading in
TESTING_TASKS.md. :::
:::task-stub{title="Expand tkinter_utils UI helper backlog"}
- Inspect
ryan_library/functions/tkinter_utils.py, noting GUI factory functions, dialogs, and side effects. - Produce tasks describing how to unit test these helpers (e.g., via
unittest.mockorpytest-tkinter), including environment guards for headless CI. - Account for platform-specific behaviour within each generated task.
- Insert the backlog beneath a tkinter_utils heading in
TESTING_TASKS.md. :::
:::task-stub{title="Plan pandas median_calc coverage"}
- Understand the algorithms inside
ryan_library/functions/pandas/median_calc.py, including DataFrame expectations and performance shortcuts. - Create tasks for varying dataset sizes, null handling, and dtype corner cases.
- Note fixture requirements (e.g., synthetic DataFrames) in each new task.
- Add the backlog beneath a pandas.median_calc subsection in
TESTING_TASKS.md. :::
:::task-stub{title="Map gdal_environment test generation"}
- Inspect
ryan_library/functions/gdal/gdal_environment.pyto identify configuration helpers and environment setup logic. - Write tasks covering environment variable manipulation, path resolution, and error branches without invoking real GDAL binaries.
- Document necessary monkeypatches or fixtures (e.g., temporary env vars) in each new task.
- Organise the backlog within
TESTING_TASKS.mdunder a gdal_environment heading. :::
:::task-stub{title="Break down gdal_runners behaviour"}
- Review command execution and output parsing logic in
ryan_library/functions/gdal/gdal_runners.py. - Generate tasks for success, failure, and timeout paths, including logging assertions and subprocess mocking strategies.
- Highlight external dependency considerations (GDAL CLI availability) within each task.
- Append the backlog to
TESTING_TASKS.mdbeneath a gdal_runners heading. :::
:::task-stub{title="Enumerate RORB read utilities backlog"}
- Study
ryan_library/functions/RORB/read_rorb_files.pyto understand file parsing, validation, and data transformation steps. - Draft tasks covering diverse file variants, error handling, and integration with downstream consumers.
- Specify fixture datasets and encoding considerations in the generated tasks.
- Record the backlog under a RORB.read_rorb_files heading in
TESTING_TASKS.md. :::
:::task-stub{title="Expand tuflow closure_durations backlog"}
- Inspect
ryan_library/functions/tuflow/closure_durations.pyfor algorithms and data dependencies. - Produce tasks targeting calculation logic, input parsing, and boundary cases (e.g., empty datasets, overlapping durations).
- Include notes about required fixture CSVs or shapefiles in each task.
- Add the backlog beneath a tuflow.closure_durations heading in
TESTING_TASKS.md. :::
:::task-stub{title="Explode tuflow pomm_combine coverage"}
- Analyse
ryan_library/functions/tuflow/pomm_combine.py, identifying workflows for combining datasets and handling duplicates. - Generate tasks for each logical pathway, including sorting, grouping, and error conditions.
- Document fixture creation strategies (e.g., synthetic hydrograph tables) per task.
- Append the backlog to
TESTING_TASKS.mdunder a tuflow.pomm_combine heading. :::
:::task-stub{title="Plan tuflow_common helper backlog"}
- Audit
ryan_library/functions/tuflow/tuflow_common.pyfor shared utilities used across TUFLOW workflows. - Create tasks per utility (file IO, dataframe shaping, path handling), ensuring cross-platform behaviours are covered.
- Identify external dependencies (GDAL, pandas) and note mocking requirements within each task.
- Add the backlog under a tuflow.tuflow_common heading in
TESTING_TASKS.md. :::
:::task-stub{title="Review functions init exports for coverage gaps"}
- Examine
ryan_library/functions/__init__.pyto understand the public API surface. - Generate tasks ensuring each exported helper has a corresponding test backlog entry, cross-referencing modules above.
- Flag deprecated or re-exported utilities that may need targeted smoke tests.
- Update
TESTING_TASKS.mdwith any additional tasks required to cover gaps. :::
:::task-stub{title="Assess loguru example relevance for testing"}
- Evaluate
ryan_library/functions/loguru-example.pyto determine whether it represents runnable documentation or legacy code. - If still in scope, create tasks describing lightweight regression tests or documentation validation; otherwise, author a task discussing archival/removal.
- Note dependencies on loguru configuration when generating those tasks.
- Capture the decisions and resulting tasks in
TESTING_TASKS.md. :::
:::task-stub{title="Generate classes module backlog"}
- Review
ryan_library/classesmodules (suffixes_and_dtypes.py,tuflow_string_classes.py) to catalogue dataclasses and utilities. - Produce tasks addressing construction/validation logic, serialization pathways, and integration with functions.
- Identify shared fixtures (e.g., sample schema definitions) and record them within each new task.
- Append the backlog beneath a classes heading in
TESTING_TASKS.md. :::
:::task-stub{title="Seed ryan-scripts orchestration backlog"}
- Inventory the scripts under
ryan-scripts/, grouping them by domain (12D, TUFLOW, GDAL, AutoCAD, RORB, misc). - For each group, create high-level tasks describing how to derive smoke/integration test plans (mocking external binaries, sample datasets, CLI harnesses).
- Ensure the generated tasks highlight dependencies on the underlying library modules so scheduling can be coordinated.
- Document the backlog additions under a new ryan-scripts section in
TESTING_TASKS.md. :::
:::task-stub{title="Assess ryan_library.processors and scripts for integration test needs"}
- Review controllers in
ryan_library/processorsandryan_library/scriptsto map their orchestration flow and dependencies on the functions modules. - Document existing CLI entry points, configuration files, or environment variables they expect so future integration tests can simulate realistic scenarios.
- Recommend smoke-test candidates that validate processor pipelines end-to-end without invoking heavyweight external binaries, outlining required stubs.
- Flag modules that should remain untested due to deprecation or reliance on unavailable licensed software, with rationale. :::
:::task-stub{title="Evaluate ryan_library/classes and shared utilities for foundational tests"}
- Inspect data classes and helper abstractions in
ryan_library/classesand cross-reference where they are instantiated across the repository. - Determine serialization/deserialization behaviours, validation logic, or computational algorithms that merit unit-level assertions.
- List reusable fixtures (e.g., sample configuration objects) and propose how to structure them under a future
tests/conftest.py. - Record potential side effects (file system, network) that will require isolation via monkeypatching or temporary directories. :::
:::task-stub{title="Compile overarching testing roadmap"}
- Consolidate findings from the above audits into a single roadmap document under
tests/README.mddetailing sequencing, ownership, and scope for upcoming test suites. - Define coding standards for the new tests (naming, fixtures, mocking approach) aligned with repository conventions.
- Outline continuous integration implications, including any additional dependencies or environment setup steps that tests will require.
- Provide estimates for effort and identify opportunities to parallelise work across contributors. :::
:::task-stub{title="Source RORB data for testing and validation"}
- Locate or generate representative RORB
batch.outfiles and hydrograph CSVs that cover various scenarios (different units, AEPs, TPs). - Ensure these files are anonymized or suitable for inclusion in the repository as test fixtures.
- Place these files in a dedicated directory (e.g.,
tests/data/RORB) to support integration testing and validation ofread_rorb_files.py. - Update
tests/functions/RORB/test_read_rorb_files.pyto utilize these real files for more robust testing, replacing or augmenting the currentxfailtest case. :::