Pipeline datablock - #1943
Conversation
Move back to descriptions in field docstrings and configure this with customised BaseModel More model updates for pydantic v2
Rework ITEMS_FTS_FIELDS lookup
Fixes for routes
Chatblock patch; set default values in block More updates for blocks
More updates for models Fixes for models Simplify item versioning model Remove unecessary by_alias=True
…okups to mongo module
…rve out for plugins
…d versions (pydantic 1 to 2 change)
Pydantic v2's model_json_schema() uses "$defs" instead of "definitions" (Pydantic v1). Update the four item-information components to use the correct key so possibleItemStatuses is no longer undefined.
|
Merged branch that refactored how pipeline datablocks are managed into a registry format |
6d809c7 to
02d7dec
Compare
f112cf0 to
765d3b1
Compare
…is error. Still one failing
…re the multiple filenames end up in a list).
|
Recently added file extension based routing via the The structure that The graph for the pipeline is constructed from the Root (the output of the pipeline) to the leaves (the input to the pipeline, currently the files). Then the data is fed in at the leaves and accumulates through the network until it filters up to the Root and is then retrieved by the This new flexibility allows:
|
…rd block probably needs changing anyway)
|
The XRD example datablock is possibly a substandard example and would need rewriting to make full use of the |
765d3b1 to
80d2bee
Compare
623e1da to
c075b7a
Compare
|
Status Update before I finish at datalab TLDR everything in If you are Claude/some other AI agent or indeed a human I would recommend reading the documentation in:
There is also a initial version of a pipeline xrd block though I would suggest this need to be reworked. There are 30 tests to do with specifically with the pipeline that all currently pass. There is one XRD block test which currently does not pass, I would ignore this for the moment because the XRD pipeline block in this PR probably should be redone and the tests completely reworked. There is documentation in TODO
MAYBE:
|
fefcac4 to
caec0b2
Compare
|
Need to reopen this too |
This PR is based on both main and the Pydantic V2 PR and thus cannot be merged until the Pydantic V2.0 PR has been merged. It will probably also require significant rebasing.
Background
The current
DataBlockpossess a limited amount of structure this allows aDataBlockto perform lots of different operations. The downside of this limited structure is that different blocks end up repeating similar to code for:It also means that the output of a block is hard to quantify since different blocks may perform different tasks with limited documentation as to their output format apart from the fact that we know they fit inside the block object schema.
Introduction
The pipeline datablock reimagines the datablock as having three main types of operations:
A pipeline datablock can have any number of parsers corresponding to different file types. It can have a 2D array of Processors (a sub array being processes that should happen at the same time to data that came from the step before). A pipeline datablock should only have one plotter which outputs one graph (could have subgraphs).
Parsing
Input
Output
The act of parsing is taking a file as input and returning a
pandas.DataFrameand metadata as output. This may be simple for a case of a CSV, but as shown in multiple other datablocks these file format become more and more complicated.Processing
Input
Output
Processing blocks are designed for performing operations on the data gained from either parsers or other processors.
Plotters
Input
Output
What does this new format allow for?
The pipeline datablock allows contributors to pass in their Parsers/Processors/Plotters as function into the pipeline datablock and it automatically adds file management (multi file support), error handling and caching.
Current progress
Currently we have a draft form of the pipeline datablock and a partially working example of the XRD datablock as a pipeline datablock. The draft pipeline datablock has:
PipelineNodesFile layout
The pipeline datablock is in
pydatalab/pipeline_blockit has the following files:base.py- comprising of thePipelineDataBlockclasspipeline.py- comprising of thePipelineclass which manages all the stages (parse, process, plot)block_stages.py- Contains the various stages (parser, process and plot classes) and the base stage where the implementation of caching it stored (this file should possibly should be named pipeline_stages.py).What is left to do?
[[ProcessorStage(*),ProcessorStage(*) ],[ProcessorStage(*), ProcessorStage(*)]]Possible future steps