Skip to content

refactor analysisparameters metadata to be flat and add line_start line_stop to all radon functions. #3

@cudmore

Description

@cudmore

Work on @src/kymflow_core/kym_file.py radon analysis parameters and @src/kymflow_core/metadata.py AnalysisParameters.

  1. right now, analysis parameters has a structure like this:
    """
    "analysis_parameters": {
    "algorithm": "mpRadon",
    "parameters": {
    "window_size": 16,
    "start_pixel": null,
    "stop_pixel": null,
    "use_multiprocessing": true
    },
    "analyzed_at": "2025-11-20T06:01:10.639839+00:00",
    "result_path": null
    }
    """

I want to move remove the 'parameters' key and put all its keys like window_size, start_pixel, etc into the main analysis parameters data class (for example, at the same level as 'algorithm'.

  1. This will change how we save and then load a @src/kymflow_core/kym_file.py @src/kymflow_core/metadata.py.

Our unit test data in @DaTa do not have any saved analysis (no json files). When we run the tests, perform analysis and save analyssi (all in a temp folder). I want a new unit test to ensure all fields programatically declared in AnalysisParameters are actually saved to the json file.

  1. I want to expand @src/kymflow_core/kym_file.py analyze_flow():
    """
    def analyze_flow(
    self,
    window_size: int,
    *, # boundary between positional and keyword-only arguments
    start_pixel: Optional[int] = None,
    stop_pixel: Optional[int] = None,
    progress_callback: Optional[ProgressCallback] = None,
    is_cancelled: Optional[CancelCallback] = None,
    use_multiprocessing: bool = True,
    ) -> None:

"""

To include 2 new parameters like:
start_line: Optional[int] = None,
stop_line: Optional[int] = None,

3.1 we then need to add these parameters to the @src/kymflow_core/metadata.py AnalysisPArameters (like we have start_pixel and stop_pixel)

Recap:

For now we are not really using the concept of start/stop pixel or start/stop line. In a future github issue I will explain a refactor to use these to analyze a rectangular ROI of a kymfile tif np image. This will require adding line parameters to @src/kymflow_core/kym_flow_radon_gpt.py mp_analyze_flow()

  1. add the same parameters to mp_analyze_flow()
    start_line: Optional[int] = None,
    stop_line: Optional[int] = None,

make sure we chose defaults based in n_time (like stop pixel uses n_space)

  1. start_line and stop_line also have to be added to @src/kymflow_core/metadata.py AnalysisParameters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions