BlueQuartzSoftware / simplnx

The backend algorithms and framework associated with DREAM3DNX, a data analysis program for materials science data analytics
http://www.dream3d.io/
Other
7 stars 9 forks source link

Python Bindings Known Issues #913

Open imikejackson opened 4 months ago

imikejackson commented 4 months ago

Actions need to be documented

@imikejackson

Filter Parameters Documentation

@imikejackson

Each Parameter should have a screen shot from the User Interface to help the user identify the parameter

IDE Filter Documentation

@imikejackson

Update the .pyi files to include first paragraph from filters documentation

imikejackson commented 4 months ago
imikejackson commented 4 months ago

Pipeline Objects

import simplnx as nx
import nxutility
import numpy as np

# Create the DataStructure instance
data_structure = nx.DataStructure()
# Read the pipeline file
pipeline = nx.Pipeline().from_file( 'lesson_2.d3dpipeline')

# Append a new filter onto the end of the pipeline
create_geom_args : dict = {
        "array_handling": 0,
        "cell_attribute_matrix_name": "Cell Data",
        "dimensions": [ 100, 100, 100 ],
        "geometry_name": nx.DataPath("Output Geometry"),
        "geometry_type": 0,
        "length_unit_type": 7,
        "origin": [ 0.0, 0.0, 0.0 ],
        "spacing": [ 1.0, 1.0, 1.0 ],
        "warnings_as_errors": False
}

# Execute the modified pipeline
pipeline.append(nx.CreateGeometryFilter(), create_geom_args)
result = pipeline.execute(data_structure)
nxutility.check_pipeline_result(result=result)

pipeline.to_file( "Modified Pipeline", "Pipelines/lesson_2_modified_pipeline.d3dpipeline")

The last line in this python will fail because not all of the arguments are present in the create_geom_args dictionary. We should just write it out using the default arguments at that point

imikejackson commented 4 months ago

Pipeline Filter

There should be easier access to the "human_name" and the "name" attributes for the Pipeline filter, i.e., a developer should not have to jump through pipeline_filter.get_filter().human_name()

pipeline_filter.human_name()
pipeine_filter.name()
imikejackson commented 4 months ago

C++ Filter Naming

All filters should end with "Filter"

imikejackson commented 4 months ago

PreflightUpdatedValues

In the Python Filter, one cannot return preflight updated values.

The following does not work, throwing an error about supported types.

return nx.IFilter.PreflightResult(output_actions=output_actions, errors=None, warnings=None, preflight_values=preflight_values)

Progress Messages:

This does not work because ProgressMessage is not exposed

    message_handler(nx.IFilter.Message(nx.IFilter.Message.Type.Progress, f'Progress Message:', 50))

DataStructure API Additions

path_exists(nx.DataPath)
path_exists(str)
nx.filter.XXX
nx.parameter.XXX
nx.geometry.XXX

AttributeMatrix API Additions

tuple_shape()
component_shape()
__size__() 
imikejackson commented 4 months ago

Breakdown the API into more namespaces

This is Non-Trivial. Putting a pin in it for now. The real problem is generating the .pyi files with the namespace