Skip to content

Unexpected/extraneous sensitivity of PipelineItem.run to class __name__ #323

Description

@keara-soloway

PipelineItem.run attempts to resolve ambiguity in class names by creating a prompt for text input. This is unexpected and not ok for automated pipelines. I am not sure it is really helpful in resolving ambiguity either. For example:

from CHAP.saxswaxs.processor import SetupProcessor as SP
x = SetupProcessor.run(data=None)

results in this CLI prompt:

Found multiple classes named SetupProcessor in CHAP
Use SetupProcessor from: (1, 2):
  1: CHAP.saxswaxs.processor
  2: CHAP.utils.fit

But the code imports a specific SetupProcessor and calls .run on it, so there should be no ambiguity on which to use, right? CHAP.saxswaxs.processor.SetupProcessor.run(cls, **kwargs) should know that it is supposed use CHAP.saxswaxs.processor.SetupProcessor. It should not traverse through all of CHAP for objects with the same __name__ as cls.__name__ and offer those up as options -- we can just use cls always, right?.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions