Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
360 commits
Select commit Hold shift + click to select a range
9085f8d
Feat: Stage configs written for example pipeline 2
pikes-ons Jul 16, 2026
f1e8e4e
Tweaked file paths for example_2 pipeline
pikes-ons Jul 17, 2026
ffb69ce
fix: added get_stage_config() method to return the dict(self._variabl…
BelowBayesline Jul 17, 2026
b8d746d
Added custom warning
BelowBayesline Jul 17, 2026
e88b2a1
Added whitespace and todo
BelowBayesline Jul 17, 2026
c5c1b6b
Created main2.py in example 1 to show order of stages provided is les…
BelowBayesline Jun 30, 2026
f339a79
Added TODOs, tweaked pipeline construction logic
BelowBayesline Jun 30, 2026
716cbce
tweak: Removed Union[] and replaced with | operator
BelowBayesline Jun 30, 2026
432ce6f
Merge branch 'example_2' into pipeline_handling
BelowBayesline Jul 17, 2026
ff7d185
feat: Added TODOs for approaching Config, with initial config structure
BelowBayesline Jul 17, 2026
4129583
tweak: added TODO for conf.yaml in example2 pipeline to handle differ…
BelowBayesline Jul 17, 2026
c1677d7
Merge branch 'feat/config' of https://github.com/ONSdigital/onsrap in…
pikes-ons Jul 20, 2026
39737cb
Tweak: add error messages for TODOs regarding Pipeline backend, execu…
pikes-ons Jul 20, 2026
a562c04
tweak: Reordered methods in Pipeline Class to suitable order
pikes-ons Jul 20, 2026
d31a888
feat: add a new class method to Pipeline - add_dependencies()
pikes-ons Jul 20, 2026
b51126f
tweak: removed a blank line but clearing all changes before next commit
pikes-ons Jul 20, 2026
760bedf
feat: Add methods to allow stages_to_run configuration to be parsed t…
pikes-ons Jul 20, 2026
be80a13
tweak: improve error messaging in _load_config_mapping() method
pikes-ons Jul 21, 2026
e615cdb
feat: improves _split_config_sections method and adds _extract_keys m…
pikes-ons Jul 21, 2026
732cda0
tweak: added normalized aliases for stages_to_run - further may be ne…
pikes-ons Jul 21, 2026
e744d00
tweak: adjusted _extract_stages_run method to return None value if no…
pikes-ons Jul 21, 2026
269d218
fix: correct all tests in test_execution.py to run with changes
pikes-ons Jul 21, 2026
928c85d
fix: correct pytests in test_stage.py. Removed run parameter in stage…
pikes-ons Jul 21, 2026
a4cda10
fix: fix pytests in test_pipeline.py and test_stage.py
pikes-ons Jul 21, 2026
1da852b
fix: pytests in test_pipeline_architecture.py
pikes-ons Jul 22, 2026
6757e35
feat: updated example pipeline 2 to run off a config file. Further wo…
pikes-ons Jul 22, 2026
2496890
tweak: example pipeline 2 to enable logs to work
pikes-ons Jul 22, 2026
c0f9139
Removed Union[] calls
BelowBayesline Jul 22, 2026
be3a373
Changed constructor stage definition logic. Added Method to handle st…
BelowBayesline Jul 22, 2026
3a1bb29
tweak: visual changes
BelowBayesline Jul 22, 2026
d748fd4
tweak: indentation
BelowBayesline Jul 22, 2026
a1508f2
feat: Added enabled stage initial structure but with TODOs to handle …
BelowBayesline Jul 22, 2026
5a5f2cc
tweak: removed TODO from Stage
BelowBayesline Jul 22, 2026
56552ca
tweak: resolved comments from PR on returned error message richness.
BelowBayesline Jul 22, 2026
35099f0
Merge pull request #31 from ONSdigital/resolve_todos
BelowBayesline Jul 22, 2026
b3df0fe
Merge pull request #36 from ONSdigital/pipeline_handling
BelowBayesline Jul 22, 2026
bdf200b
tweak: add __str__ method and __repr__ method to Stage class
pikes-ons Jul 23, 2026
8662629
doc: add docstrings for __str__ and __repr__ for stage class
pikes-ons Jul 23, 2026
021d2b5
feat: __str__ and __repr__ functions for Pipeline class
pikes-ons Jul 23, 2026
2b0daa2
feat: __str__ and __repr__ methods for PipelineRunner class actioning…
pikes-ons Jul 23, 2026
320f508
feat: add __str__ and __repr__ methods to additional classes used in …
pikes-ons Jul 23, 2026
58dd76d
tweak: mild adjustments to all __str__ and __repr__ methods to tidy u…
pikes-ons Jul 23, 2026
679a0e1
test: tests fixed for test_pipeline.py and test_pipeline_architecture…
pikes-ons Jul 23, 2026
a5ad358
test: add pytest to check that example pipelines 1 and 2 run properly…
pikes-ons Jul 23, 2026
47ada51
tests: new tests added for test_execution and test_models
pikes-ons Jul 24, 2026
da36b1d
Merge pull request #39 from ONSdigital/feat/dunder_str_methods
BelowBayesline Jul 24, 2026
7272250
test: tests fixed for test_pipeline.py and test_pipeline_architecture…
pikes-ons Jul 23, 2026
b4f1ef0
test: add pytest to check that example pipelines 1 and 2 run properly…
pikes-ons Jul 23, 2026
3e28b32
tests: new tests added for test_execution and test_models
pikes-ons Jul 24, 2026
003a055
Merge branch 'test_warning_resolutions' of https://github.com/ONSdigi…
pikes-ons Jul 27, 2026
951f0e7
fix: Tweaked tests to resolve issues with KeyErrors making assertions…
BelowBayesline Jul 28, 2026
3d76484
Added space for a local playground to dynamically test systems
BelowBayesline Jul 24, 2026
cd7f694
Added simple context injection for example 2 (doesn't currently work …
BelowBayesline Jul 24, 2026
08a42de
Added global variables section for example 2 config for later impleme…
BelowBayesline Jul 24, 2026
e38130f
feat: Initial implementation of dynamic Stage adjustment in Pipeline …
BelowBayesline Jul 24, 2026
ca3ec1c
redid stage_config_for() method
BelowBayesline Jul 24, 2026
09fed0f
added TODO for models
BelowBayesline Jul 24, 2026
bea4e45
fix: Updated __repr__ methods that had inconsistent spacing
BelowBayesline Jul 24, 2026
341c8f3
fix: added 'sandbox' in tests for ignore
BelowBayesline Jul 24, 2026
9c7ab9a
feat: added enable_stages to allow users to immediate enable added st…
BelowBayesline Jul 24, 2026
4f71e21
fix: updated _rebuild_graph to remove redundant code and clarified do…
BelowBayesline Jul 24, 2026
3872a61
fix: warning wasn't printing full message due to structure.
BelowBayesline Jul 28, 2026
1583c21
fix: added __name__==__main__ behaviour to fix main() being called at…
BelowBayesline Jul 28, 2026
4ff1f56
fix: resolved get_stage_config() behaviour and data-parsing contracts…
BelowBayesline Jul 28, 2026
74f92e2
Merge pull request #54 from ONSdigital/test_warning_resolutions
BelowBayesline Jul 28, 2026
ccd908c
feat: add GlobalConfig and from_dict method. add GlobalConfig to Stag…
pikes-ons Jul 27, 2026
1176083
feat: combine_vars method to combine global variables and stage varia…
pikes-ons Jul 27, 2026
45b8f3a
tweak: adjust StageConfig so global variables aren't stored as an att…
pikes-ons Jul 27, 2026
6e33a6b
feat: add getter method for GlobalConfig and tweak from_dict method d…
pikes-ons Jul 27, 2026
8637294
feat: move _combine_vars() method from StageConfig class to Execution…
pikes-ons Jul 27, 2026
09bb2ea
tweak: remove mention of global variables from StageConfig instance a…
pikes-ons Jul 27, 2026
61a24dc
tweak: adjust order of attributes for ExecutionContext and add initia…
pikes-ons Jul 27, 2026
488e6c2
tests: tests implemented for _combine_vars method and minor tweak to …
pikes-ons Jul 27, 2026
815e705
docs: documentation added for tests from previous commit.
pikes-ons Jul 27, 2026
4bf8c96
tweak: add global_config parameter to ExecutionContext creation withi…
pikes-ons Jul 27, 2026
80169d0
feat: add GlobalConfig instantiation into _resolve_config method
pikes-ons Jul 27, 2026
371b9e8
fix: added GlobalConfig to init file to allow importing
BelowBayesline Jul 28, 2026
d5a406f
fix: tweaks to Stage and Global Configuration handling in Pipeline
BelowBayesline Jul 28, 2026
e7fcaae
Tweaked stageConfig.from_mapping()
BelowBayesline Jul 28, 2026
f940d51
fix: changes to execution and tests
BelowBayesline Jul 28, 2026
7cd3020
fix: added "global_variables" and "global_vars" as options for keys i…
pikes-ons Jul 29, 2026
4066622
Merge pull request #58 from ONSdigital/fix/example_2
pikes-ons Jul 29, 2026
d345aec
feat: add config attribute to RunManifest, implement through _create_…
pikes-ons Jul 29, 2026
e7670c2
feat: add a _log_config() method and implement through PipelineRunner
pikes-ons Jul 29, 2026
c8e703e
test: add formatting unit test for _log_config to check that the corr…
pikes-ons Jul 29, 2026
ea26b2e
tweak: adjusted _combine_configs to force the output of global_config…
pikes-ons Jul 29, 2026
8bd700e
test: implement integration test for _log_configs method within Pipel…
pikes-ons Jul 29, 2026
ff6b275
tweak: added warning messages into integration test for logging config
pikes-ons Jul 29, 2026
21b6921
docs: add documentation to pytests for configuration logging
pikes-ons Jul 29, 2026
3b52797
feat: added a function to differentiate two configuration files and p…
pikes-ons Jul 30, 2026
4d957f3
docs: documentation for configuration differencing functions
pikes-ons Jul 30, 2026
6dc5650
docs: documentation added for test created for config differencing fu…
pikes-ons Jul 30, 2026
d670129
tweak: add warnings to _resolve_config() that alerts when an output l…
pikes-ons Aug 3, 2026
7809937
tweak: created a new method that assesses for output directories in s…
pikes-ons Aug 3, 2026
1c44bfe
tweak: correct name of resolve_output_root() method in warning for _c…
pikes-ons Aug 3, 2026
a4ff55f
tweak: minor changes to output checking method
pikes-ons Aug 3, 2026
c5ffd4e
feat: adjusted output directory search to cover regex
pikes-ons Aug 3, 2026
d6ffb7b
tweak: add overwrite parameter to PipelineConfig that defaults to False
pikes-ons Aug 3, 2026
0b124d9
feat: add _output_dir_conflict_check() method and apply it to Pipelin…
pikes-ons Aug 3, 2026
913bc1f
tweak: add overwrite attribute to __str__ method and __repr method fo…
pikes-ons Aug 3, 2026
52893b2
feat: add logging for error message with _output_dir_conflict_check()…
pikes-ons Aug 3, 2026
479947b
docs: add documentation for _output_dir_conflict_check()
pikes-ons Aug 3, 2026
c0d7584
feat: combine _check_output_dir_in_stage_configs into _output_dir_con…
pikes-ons Aug 3, 2026
648fefd
docs: add inline comment on what the regex covers
pikes-ons Aug 4, 2026
e4f7c11
tweak: add output_dir_regex as a module level global variable
pikes-ons Aug 4, 2026
339e2de
Apply suggestions from code review
pikes-ons Aug 4, 2026
6b03ede
Merge pull request #60 from ONSdigital/config_logging
pikes-ons Aug 4, 2026
6cc4068
Apply suggestions from code review
pikes-ons Aug 4, 2026
65650e8
Merge pull request #62 from ONSdigital/fix/output_locations
pikes-ons Aug 4, 2026
d7ef508
tweak: correct indenting error in add_stage_config
pikes-ons Aug 4, 2026
d1e8928
feat: add method to generate an ExecutionContext type for a pipeline …
pikes-ons Aug 4, 2026
415b5c8
tweak: reorder where _generate_context is called to allow for stage p…
pikes-ons Aug 4, 2026
bb715fe
test: add test for generate_context()
pikes-ons Aug 4, 2026
0854c7d
test: implement test for _validate_stage_backends()
pikes-ons Aug 4, 2026
85da7d7
test: correct errors in test_pipeline and test_pipeline_architecture …
pikes-ons Aug 5, 2026
709bb26
tweak: CoPilot refactor (human review) tests into class structure
pikes-ons Aug 5, 2026
b6c8c85
tweak: ruff formatting and linting applied
pikes-ons Aug 5, 2026
fc9c792
doc: add doc strings for each test in test_pipeline
pikes-ons Aug 5, 2026
ce8f252
tweak: refactor test_stage.py to class structure
pikes-ons Aug 5, 2026
00b7f09
tweak: ruff format and check test_stage.py
pikes-ons Aug 5, 2026
bf1e80d
tweak: CoPilot refactor (human review) of test_execution to add class…
pikes-ons Aug 5, 2026
029fb6e
docs: added docstrings to tests in test_execution.py
pikes-ons Aug 5, 2026
2d008d1
tweal: test_models.py refactor tests into classes with CoPilot, utili…
pikes-ons Aug 5, 2026
8ad6173
tweak: split test_from_file into two methods to act as singular unit …
pikes-ons Aug 5, 2026
6dc30ea
docs: complete docstrings for test_models.py
pikes-ons Aug 5, 2026
e521839
tweak: refactor with CoPilot to structure tests as classes
pikes-ons Aug 5, 2026
00459e2
docs: add docstrings for all tests in test_pipeline_architecture.py
pikes-ons Aug 5, 2026
3284690
tweak: ruff format and check test_pipeline_architecture.py
pikes-ons Aug 5, 2026
c7311c8
tweak: refactor test_runner.py with CoPilot (human review) to be stru…
pikes-ons Aug 5, 2026
44ebe47
docs: add doc strings to test_runner.py methods
pikes-ons Aug 5, 2026
2635d51
tweak: Ruff formatting and checking on test_runner.py
pikes-ons Aug 5, 2026
9a8e79c
docs: add parameters and raises sections to docstrings of all test files
pikes-ons Aug 5, 2026
da2a8ce
tweak: switch around tests in test_stage.py to more logically fit the…
pikes-ons Aug 6, 2026
1975371
tests: added additional tests to test_stage.py on recommendation from…
pikes-ons Aug 6, 2026
40c232f
feat: adds to_dict and from_dict methods to PipelineRun, StageResult,…
pikes-ons Aug 6, 2026
746384d
tests: adds tests for to_dict and from_dict methods for PipelineRun, …
pikes-ons Aug 6, 2026
eeafbc6
test: add test to check that log_pipeline_attributes correctly writes…
pikes-ons Aug 6, 2026
3101545
tweak: minor change to _log_pipeline_attributes() to remove StageResu…
pikes-ons Aug 6, 2026
0a3de03
feat: method for loading a PipelineRun instance from a previous run file
pikes-ons Aug 6, 2026
adad824
tweak: move load_pipeline_run_for_historical_run() method into Pipeli…
pikes-ons Aug 7, 2026
b366387
tweak: add leading _ to runmanifest_to_dict and runmanifest_from_dict…
pikes-ons Aug 7, 2026
c6efc58
tweak: move run_output derivation into Pipeline init phase
pikes-ons Aug 7, 2026
458d286
tweak: add an error message to cover where historical pipeline runs l…
pikes-ons Aug 7, 2026
a0f10be
feat: add a function that reviews the log file and extracts all run_i…
pikes-ons Aug 7, 2026
266744e
feat: add method that allows historical runs to be loaded as Pipeline…
pikes-ons Aug 7, 2026
02ff9df
feat: added in methods to load the latest run from a cold run log int…
pikes-ons Aug 7, 2026
82eea41
tweak: reorder _load_latest_run method in pipeline.py to sit with res…
pikes-ons Aug 10, 2026
3a6345d
tweak: correct error message in _load_latest_run
pikes-ons Aug 10, 2026
776e52d
tests: add testing for load_latest_run method with fully mocked data
pikes-ons Aug 10, 2026
490aac0
docs: edit documentation to clarify what the parameters refer to
pikes-ons Aug 10, 2026
84e8c6b
tweak: added init values and changed code and documentation style to …
BelowBayesline Aug 10, 2026
be48e0d
feat: commit-hooks: added mypy checks for static type checking
BelowBayesline Aug 10, 2026
9ac640b
fix: overhauled & updated Package metadata files
BelowBayesline Aug 10, 2026
a99a5ff
tweak: updated python package yaml
BelowBayesline Aug 10, 2026
2c4d43e
tweak: stricter typing and code/documentation standardised style
BelowBayesline Aug 10, 2026
c116d68
tweak: tweaked approach to loggers to improve memory efficiency
BelowBayesline Aug 10, 2026
22cd71c
tweak: minor changes in code style and specificities.
BelowBayesline Aug 10, 2026
22cc451
tweak: adds potential issue for review in PR
pikes-ons Aug 10, 2026
b11e261
tweak: extract_historical_run_ids to exclude if the timestamp is inco…
pikes-ons Aug 10, 2026
52193d5
tests: implement tests for extract_historical_run_ids
pikes-ons Aug 10, 2026
9c40364
Apply suggestions from code review
pikes-ons Aug 10, 2026
d2778d6
Merge pull request #63 from ONSdigital/fix/generate_execution_context
pikes-ons Aug 10, 2026
108a7c8
feat: adds to_dict and from_dict methods to PipelineRun, StageResult,…
pikes-ons Aug 6, 2026
b90d66f
tests: adds tests for to_dict and from_dict methods for PipelineRun, …
pikes-ons Aug 6, 2026
f058b8f
test: add test to check that log_pipeline_attributes correctly writes…
pikes-ons Aug 6, 2026
dc41be7
tweak: minor change to _log_pipeline_attributes() to remove StageResu…
pikes-ons Aug 6, 2026
4d15255
feat: method for loading a PipelineRun instance from a previous run file
pikes-ons Aug 6, 2026
b881574
tweak: move load_pipeline_run_for_historical_run() method into Pipeli…
pikes-ons Aug 7, 2026
7949826
tweak: add leading _ to runmanifest_to_dict and runmanifest_from_dict…
pikes-ons Aug 7, 2026
42227d4
tweak: move run_output derivation into Pipeline init phase
pikes-ons Aug 7, 2026
12a99c0
tweak: add an error message to cover where historical pipeline runs l…
pikes-ons Aug 7, 2026
607d73a
feat: add a function that reviews the log file and extracts all run_i…
pikes-ons Aug 7, 2026
72224d7
feat: add method that allows historical runs to be loaded as Pipeline…
pikes-ons Aug 7, 2026
9d86438
feat: added in methods to load the latest run from a cold run log int…
pikes-ons Aug 7, 2026
2577f97
tweak: reorder _load_latest_run method in pipeline.py to sit with res…
pikes-ons Aug 10, 2026
f9887fa
tweak: correct error message in _load_latest_run
pikes-ons Aug 10, 2026
66d1932
tests: add testing for load_latest_run method with fully mocked data
pikes-ons Aug 10, 2026
0994a2c
docs: edit documentation to clarify what the parameters refer to
pikes-ons Aug 10, 2026
34a436a
tweak: adds potential issue for review in PR
pikes-ons Aug 10, 2026
1adb441
tweak: extract_historical_run_ids to exclude if the timestamp is inco…
pikes-ons Aug 10, 2026
dad0bb6
tests: implement tests for extract_historical_run_ids
pikes-ons Aug 10, 2026
50fa788
tweak: tidy up test_pipeline.py imports
pikes-ons Aug 10, 2026
5aea1ef
Merge branch 'feat/run_history' of https://github.com/ONSdigital/onsr…
pikes-ons Aug 10, 2026
70168d0
test: added stages to the fixture Pipeline so that it passes the gene…
pikes-ons Aug 10, 2026
ec89e81
tweak: adjust load_latest_run to account for errors in importing hist…
pikes-ons Aug 10, 2026
7a5885a
tests: produce tests for load_historical_run method and minor tweak o…
pikes-ons Aug 11, 2026
339150b
test: correct errors in test_pipeline and test_pipeline_architecture …
pikes-ons Aug 5, 2026
2ad8472
tweak: CoPilot refactor (human review) tests into class structure
pikes-ons Aug 5, 2026
374bf88
tweak: ruff formatting and linting applied
pikes-ons Aug 5, 2026
a97c64f
doc: add doc strings for each test in test_pipeline
pikes-ons Aug 5, 2026
a5f1f65
tweak: refactor test_stage.py to class structure
pikes-ons Aug 5, 2026
0cc1882
tweak: ruff format and check test_stage.py
pikes-ons Aug 5, 2026
05d535c
tweak: CoPilot refactor (human review) of test_execution to add class…
pikes-ons Aug 5, 2026
f1fba22
docs: added docstrings to tests in test_execution.py
pikes-ons Aug 5, 2026
1426926
tweal: test_models.py refactor tests into classes with CoPilot, utili…
pikes-ons Aug 5, 2026
f482133
tweak: split test_from_file into two methods to act as singular unit …
pikes-ons Aug 5, 2026
134d1ab
docs: complete docstrings for test_models.py
pikes-ons Aug 5, 2026
2e5f425
tweak: refactor with CoPilot to structure tests as classes
pikes-ons Aug 5, 2026
d330fbb
docs: add docstrings for all tests in test_pipeline_architecture.py
pikes-ons Aug 5, 2026
b013120
tweak: ruff format and check test_pipeline_architecture.py
pikes-ons Aug 5, 2026
09e9fd6
tweak: refactor test_runner.py with CoPilot (human review) to be stru…
pikes-ons Aug 5, 2026
83b72f3
docs: add doc strings to test_runner.py methods
pikes-ons Aug 5, 2026
30171a8
tweak: Ruff formatting and checking on test_runner.py
pikes-ons Aug 5, 2026
5fa1db2
docs: add parameters and raises sections to docstrings of all test files
pikes-ons Aug 5, 2026
cebb435
tweak: switch around tests in test_stage.py to more logically fit the…
pikes-ons Aug 6, 2026
02399f7
tests: added additional tests to test_stage.py on recommendation from…
pikes-ons Aug 6, 2026
63c4ae2
Merge branch 'fix/testing_checkpoint' of https://github.com/ONSdigita…
pikes-ons Aug 11, 2026
4723a4c
test: add fixture for integration testing
pikes-ons Aug 11, 2026
54b637d
tweak: correct failed tests given merge with execution context work
pikes-ons Aug 11, 2026
3aa29cf
tests: add integration tests for load_latest_run
pikes-ons Aug 11, 2026
d7141c7
tweak: add warning if no stages are defined in a Pipeline
pikes-ons Aug 11, 2026
b6a8b37
tweak: add example_function fixture into TestStage
pikes-ons Aug 11, 2026
0c99233
Apply suggestions from code review
pikes-ons Aug 11, 2026
9246dd7
tweak: adjust gitignore for example scripts
pikes-ons Aug 11, 2026
b9aa104
Merge pull request #64 from ONSdigital/fix/testing_checkpoint
pikes-ons Aug 11, 2026
9d1eba1
Merge branch 'feat/config' into feat/run_history
pikes-ons Aug 11, 2026
22fa840
tweak: slight changes made to method names and processing for last_ru…
pikes-ons Aug 11, 2026
e54b771
tweak: adjusted tests in test_pipeline_architecture to account for wa…
pikes-ons Aug 11, 2026
7b2ecee
test: adjust tests to account for warnings raised
pikes-ons Aug 11, 2026
731ffce
tests: finish implementation tests for run_history
pikes-ons Aug 11, 2026
2ba54b3
tests: separate some of the tests for run_history work into test_load…
pikes-ons Aug 11, 2026
5800b56
tweak: provide warning message if a particular run directory does not…
pikes-ons Aug 11, 2026
1f4dfbe
tests: started integration tests for all_runs
pikes-ons Aug 11, 2026
071bea2
tweak: changes to Pipeline docs and code structure.
BelowBayesline Aug 12, 2026
a34dd04
feat: Added workflows for package build testing and doc deployment.
BelowBayesline Aug 12, 2026
2d2e273
Merge branch 'feat/config' into feat/refactor
BelowBayesline Aug 12, 2026
72ee4c7
tweak: changed Pipeline to utilise _generate_context properly.
BelowBayesline Aug 12, 2026
08a09af
fix: improved formatting in workflows yaml files
BelowBayesline Aug 12, 2026
a0a37bf
tweak: eof whitespace addition
BelowBayesline Aug 12, 2026
a817063
Merge branch 'feat/run_history' into feat/config
BelowBayesline Aug 12, 2026
0a6a896
Resolve conflicts for feat/config -> dev merge
BelowBayesline Aug 12, 2026
a56523c
fix: added Ruff fix suggestions
BelowBayesline Aug 12, 2026
8a6a198
fix: Added Ruff Format changes
BelowBayesline Aug 12, 2026
b82c456
fix: workflows: added pandas install for dependency requirement prior…
BelowBayesline Aug 12, 2026
e85ed0f
tweak: workflows: remove Sphinx build from python-package.yml due to …
BelowBayesline Aug 12, 2026
149e22c
fix: mypy: resolved type problems, refactored how dependencies are as…
BelowBayesline Aug 12, 2026
976513c
fix: ruff: format tweaks.
BelowBayesline Aug 12, 2026
bc2e58e
fix: updated f-string usage to work with older versions of Python.
BelowBayesline Aug 12, 2026
9e5b5d8
fix: update to documentation on contributing.md to include more info …
BelowBayesline Aug 13, 2026
2d7b522
fix: ruff check: Resolved safe and unsafe ruff errors
BelowBayesline Aug 13, 2026
6e36d63
fix: Added fixture to allow StageResult testing to work properly.
BelowBayesline Aug 13, 2026
cd441a1
feat: added py.typed for best practice downstream type-checking infor…
BelowBayesline Aug 13, 2026
5dc0688
fix: change configuration.md to better reflect Configuration structure
BelowBayesline Aug 13, 2026
be1adc7
fix: readme.md language around Stage tweaked to better reflect use case.
BelowBayesline Aug 13, 2026
4b88644
fix: dedented dunder methods for PipelineRunner. Changed Logger._logg…
BelowBayesline Aug 13, 2026
e6135a4
fix: set orders_per_day to use idxmax not idxmin for greatest value.
BelowBayesline Aug 13, 2026
9052294
fix: Fix as part of copilot review for PR #66 - implement a safe enco…
pikes-ons Aug 17, 2026
58ec369
test: assert warnings in test_pipeline TestPipelineNamingAndInit
pikes-ons Aug 17, 2026
324f127
fix: action comment on PR #66 to check that run_ids compare names aga…
pikes-ons Aug 17, 2026
5f988b7
Merge branch 'feat/config' of https://github.com/ONSdigital/onsrap in…
pikes-ons Aug 17, 2026
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
54 changes: 54 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy Documentation

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
- name: Build documentation
run: |
python -m sphinx -b html docs docs/_build/html
- name: Configure GitHub Pages
uses: actions/configure-pages@v5

- name: Upload documentation artifact
uses: actions/upload-pages-artifact@v4
with:
path: docs/_build/html

deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy documentation
id: deployment
uses: actions/deploy-pages@v4

27 changes: 27 additions & 0 deletions .github/workflows/package-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Python Package Builds Successfully

on:
pull_request:
push:
branches:
- main
- development

jobs:
build-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install build tools
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build Package
run: |
python -m build --sdist --wheel
- name: Install Built Wheel
run: |
pip install dist/*.whl
58 changes: 40 additions & 18 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,62 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package
name: Python CI

on:
# Keep push validation narrow to the main integration branches.
push:
branches: [ "main", "development" ]

# Run CI for every pull request regardless of target branch so branch-to-branch
# work still gets the same quality and test coverage before merge.
pull_request:
branches: [ "main", "development" ]
types: [opened, synchronize, reopened, ready_for_review]

workflow_dispatch:

jobs:
build:
quality:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
- name: Install development dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
- name: Lint with Ruff
run: |
python -m ruff check onsrap
python -m ruff format --check onsrap
- name: Run security checks
run: |
python -m bandit -ll -c pyproject.toml -r onsrap
- name: Type check with mypy
run: |
python -m mypy onsrap

tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
cache: pip
- name: Install development dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
python -m pip install -e ".[dev]"
python -m pip install pandas
- name: Test with pytest
run: |
pytest
python -m pytest
16 changes: 11 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -895,18 +895,24 @@ docs/_linkcheck/
!examples/
!examples/**

# Allow logs folders and their contents inside examples
!examples/**/logs/
!examples/**/logs/**
!examples/**/*.log

# Allow scripts folders and their contents inside examples
!examples/**/scripts/
!examples/**/scripts/**
examples/**/scripts/__pycache__/

# Allow example data files
!examples/**/*.csv
!examples/**/*.xls
!examples/**/*.xlsx

examples/**/runs/**/
examples/**/runs/**/

# Ignore coding playground
tests/playground/
tests/sandbox/

# Allow logs folders and their contents inside examples
examples/**/logs/
examples/**/logs/**
examples/**/*.log
11 changes: 10 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ repos:
args: [ --fix ]
# Run ruff formatter.
- id: ruff-format
- repo: local
hooks:
- id: mypy
name: mypy - Type check onsrap package
entry: mypy
language: python
additional_dependencies: [mypy, types-PyYAML]
args: [onsrap]
pass_filenames: false
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
Expand All @@ -36,5 +45,5 @@ repos:
hooks:
- id: bandit
name: bandit - Checks for vulnerabilities
args: ["-c", "pyproject.toml"]
args: ["-ll", "-c", "pyproject.toml"]
additional_dependencies: ["bandit[toml]"]
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

All notable changes to this project will be tracked here.

## [0.1.1] - 2026-06-24

This release adds run-scoped output handling for the example pipeline and aligns runtime timestamps with local time.

### Added

- Introduced per-run output directories so each pipeline execution writes into its own `runs/<run_id>/` tree.
- Anchored the example pipeline to its own `main.py` directory so runs stay inside `examples/pipeline_1/` instead of the repository working directory.
- Routed stage output paths through `ExecutionContext.run_dir` so stages can record artifacts in the active run directory.
- Switched runtime timestamp generation to local time and kept a compatibility alias for the previous helper.
- Added regression coverage for repeated runs and run-specific output paths.


## [0.1.0] - 2026-06-22

First tracked version of `onsrap`.
Expand Down
96 changes: 73 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,20 @@ located.
```
## What is `onsrap`?

Add a summary of your project here.
Reproducible Analytical Pipelines (RAPs) are a cornerstone of high quality statistics. Reproducible refers to the concept that if code is run multiple times with the same inputs, it will produce the same outputs. A pipeline is a series of stages (small chunks of work) which are run in a specified order to produce desired outputs. Pipelines are crucial to reproducible work as they ensure that the code is run consistently. This increases the quality of the outputs by ensuring as little manual input as possible.

ONSRap is a Python package that automatically orchestrates and runs these RAPs. The goal is to standardise how pipelines are run to reduce developer time required to convert existing code into RAP standards. As well as reducing developer time, this package also supports achieving RAP standards through items 4, 6, and 10. These are accomplished through this package by:

- Item 4: Document everything that is needed to write and run the code
- This package includes inbuilt logging that records when the pipeline was run as well as the Pipeline configuration used.

- Item 6: Code modules should run end-to-end without manual intervention
- This package is designed whereby once the configuration has been provided by the user and the main.py file is run, no further human input is required.

- Item 10: Don't reinvent the wheel
- Multiple pipelines exist within the ONS and each have the potential to be orchestrated in different ways. This package aims to standardise the orchestration, ensuring consistency across pipelines. This consistency means that developers are more easily able to move between pipelines as they will all be structured in a similar way.

For more information on the ONS Rap Minimum Standards, please see the full [standards documentation][standards].

## Getting started

Expand All @@ -18,11 +31,13 @@ requirements.
It's suggested that you install this package and its requirements within
a virtual environment.

Stages should use a functional style. A ``stage`` can be a file or a callable item, such as a function. File stages should define an entrypoint function that runs the stage; files without an entrypoint can use subprocess fallback, but the package has less control over that execution mode.

There should be a parent file that sets out configuration, required directories and file paths, and builds the ``Pipeline`` instance. It is recommended that this is named something similar to ``main.py`` so that it is easy for users to see where the ``Pipeline`` starts. This file will be what is run through the terminal to run the entire pipeline.

## Requirements

- Python 3.9+ installed
- a `.secrets` file with the required [secrets and credentials](#required-secrets-and-credentials)
- to have [loaded environment variables][docs-loading-environment-variables] from `.env`
- Python 3.14.6 installed

Contributors have some additional requirements - please see our [contributing guidance][contributing].

Expand Down Expand Up @@ -53,7 +68,18 @@ Remember to update the setup and requirement files inline with any changes to yo
package.

## Running the pipeline (Python only)
### Running Your Own Pipeline
To run your own Pipeline, you will need to build a ``Pipeline`` instance. This can be built using the from_files() method which requires a list of strings or Paths for your individual ``stages``. These are then compiled into a ``Pipeline`` instance. A ``Pipeline`` instance can also be created using the from_dict() method which takes a dictionary containing each attribute of the intented ``Pipeline`` instance and converts it.

You will also need to define your ``PipelineConfig`` instance. This contains information regarding the working directory, project root, data directory, and log directory required to run the ``Pipeline`` as well as any metadata that you feel needs to be logged.

Lastly, you need to define any ``dependencies`` required for the ``stages``. These are whether any stage needs to be run before another stage. These should be structured as a dictionary with the name of the stage as the key and the value is the stage/s that need to run before it as a tuple.

Both ``PipelineConfig`` and ``dependencies`` should be parsed into the ``Pipeline`` instance.

Once you have your ``Pipeline`` instance, you can run the ``Pipeline.run()`` method which will run the entire ``Pipeline`` instance that has been created.

### Example Pipeline
The main runnable example now lives in `examples/pipeline_1/main.py`.
It builds a three-stage pipeline from numbered scripts under `examples/pipeline_1/scripts/`.
To run the example, use:
Expand All @@ -66,21 +92,12 @@ Alternatively, most Python IDEs allow you to run the code directly using a `run`

## Required secrets and credentials

To run this project, you need a `.secrets` file with [secrets/credentials as
environmental variables][docs-loading-environment-variables-secrets]. The
secrets/credentials should have the following environment variable name(s):

| Secret/credential | Environment variable name | Description |
|-------------------|---------------------------|--------------------------------------------|
| Secret 1 | `SECRET_VARIABLE_1` | Plain English description of Secret 1. |
| Credential 1 | `CREDENTIAL_VARIABLE_1` | Plain English description of Credential 1. |
No secrets or credentials are required for running this package.

Once you've added them, [load these environment variables][docs-loading-environment-variables] using
`.env`.

## Project structure layout

The cookiecutter template generated for each project will follow this folder structure:
The ONSRap repository has the following structure:

```shell
.
Expand All @@ -89,14 +106,46 @@ The cookiecutter template generated for each project will follow this folder str
│ │ ├── raw/
│ │ ├── interim/
│ │ └── processed/
│ └── onsrap/
│ ├── example_modules/
│ │ ├── __init__.py
│ │ └── example_module.py
│ ├── __init__.py
│ ├── example_config.yml
│ └── run_pipeline.py
└── ...
│ ├── onsrap/
│ │ ├── example_modules/
│ │ │ ├── __init__.py
│ │ │ └── example_module.py
│ │ ├── __init__.py
│ │ ├── errors.py
│ │ ├── execution.py
│ │ ├── graph.py
│ │ ├── loader.py
│ │ ├── models.py
│ │ ├── pipeline.py
│ │ ├── run_pipeline.py
│ │ ├── runner.py
│ │ └── stage.py
│ ├── examples/
│ │ ├── pipeline_1/
│ │ │ ├── data/
│ │ │ │ └── orders.csv
│ │ │ ├── logs/
│ │ │ │ └── onsrap.log
│ │ │ ├── runs/
│ │ │ │ └── README.md
│ │ │ └── scripts/
│ │ │ │ ├── 0_data_validation.py
│ │ │ │ ├── 1_preprocessing.py
│ │ │ │ └── 2_reporting.py
│ │ │ ├── Example.md
│ │ │ └── main.py
│ │ ├── pipeline_2/
│ │ └── pipeline_3/
│ ├── tests/
│ │ ├── __init__.py
│ │ ├── repo_tests_README.md
│ │ ├── test_execution.py
│ │ ├── test_models.py
│ │ ├── test_pipeline_architecture.py
│ │ ├── test_pipeline.py
│ │ └── test_stage.py
│ └──
└──
```

## Licence
Expand All @@ -118,3 +167,4 @@ This project structure is based on the [`govcookiecutter` template project][govc
[govcookiecutter]: https://github.com/best-practice-and-impact/govcookiecutter
[docs-loading-environment-variables]: https://github.com/best-practice-and-impact/govcookiecutter/blob/main/%7B%7B%20cookiecutter.repo_name%20%7D%7D/docs/user_guide/loading_environment_variables.md
[docs-loading-environment-variables-secrets]: https://github.com/best-practice-and-impact/govcookiecutter/blob/main/%7B%7B%20cookiecutter.repo_name%20%7D%7D/docs/user_guide/loading_environment_variables.md#storing-secrets-and-credentials
[standards]: https://best-practice-and-impact.github.io/ONS_minimum_RAP/
Loading
Loading