Skip to content

Errors in creating FlowsheetInterface from module and/or entry points do not result in test failures #8

@lbianchi-lbl

Description

@lbianchi-lbl

Symptoms

  • This occurred most recently with the initial commits of Add LSRRO GUI watertap-org/watertap#1383, where the only indication that some error had occurred was in the incomplete patch coverage (because the error occurred before the test of the test_flowsheet_interfaces tests could be run)
  • The error do show up in the output if running with pytest -s (disabling log capture)
2024-05-10 14:46:08 [ERROR] idaes.watertap.ui.fsapi: Cannot get FlowsheetInterface object for module '<module 'watertap.examples.flowsheets.lsrro.lsrro_ui' from '/home/ludo/lbl/watertap/watertap/watertap/examples/flowsheets/lsrro/lsrro_ui.py'>': 4 validation errors for FlowsheetExport
build_options.ROFiniteElements.value
  Value error, 'value' (10) not within expected range of [20-1] [type=value_error, input_value=10, input_type=int]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
build_options.NaClSolubilityLimit.value
  Value error, bool does not match the following criteria for values_allowed: must be either a list of possible values, or one of 'string', 'int', 'float'. [type=value_error, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
build_options.ConcentrationPolarization.value
  Value error, bool does not match the following criteria for values_allowed: must be either a list of possible values, or one of 'string', 'int', 'float'. [type=value_error, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
build_options.ROPressureDrop.value
  Value error, bool does not match the following criteria for values_allowed: must be either a list of possible values, or one of 'string', 'int', 'float'. [type=value_error, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
2024-05-10 14:46:08 [ERROR] idaes.watertap.ui.fsapi: Cannot get FlowsheetInterface object for module '<module 'watertap.examples.flowsheets.lsrro.lsrro_ui' from '/home/ludo/lbl/watertap/watertap/watertap/examples/flowsheets/lsrro/lsrro_ui.py'>': 4 validation errors for FlowsheetExport
build_options.ROFiniteElements.value
  Value error, 'value' (10) not within expected range of [20-1] [type=value_error, input_value=10, input_type=int]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
build_options.NaClSolubilityLimit.value
  Value error, bool does not match the following criteria for values_allowed: must be either a list of possible values, or one of 'string', 'int', 'float'. [type=value_error, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
build_options.ConcentrationPolarization.value
  Value error, bool does not match the following criteria for values_allowed: must be either a list of possible values, or one of 'string', 'int', 'float'. [type=value_error, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
build_options.ROPressureDrop.value
  Value error, bool does not match the following criteria for values_allowed: must be either a list of possible values, or one of 'string', 'int', 'float'. [type=value_error, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
2024-05-10 14:46:08 [ERROR] idaes.watertap.ui.fsapi: Cannot get FlowsheetInterface object for module '<module 'watertap.examples.flowsheets.lsrro.lsrro_ui' from '/home/ludo/lbl/watertap/watertap/watertap/examples/flowsheets/lsrro/lsrro_ui.py'>': 4 validation errors for FlowsheetExport
build_options.ROFiniteElements.value
  Value error, 'value' (10) not within expected range of [20-1] [type=value_error, input_value=10, input_type=int]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
build_options.NaClSolubilityLimit.value
  Value error, bool does not match the following criteria for values_allowed: must be either a list of possible values, or one of 'string', 'int', 'float'. [type=value_error, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
build_options.ConcentrationPolarization.value
  Value error, bool does not match the following criteria for values_allowed: must be either a list of possible values, or one of 'string', 'int', 'float'. [type=value_error, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
build_options.ROPressureDrop.value
  Value error, bool does not match the following criteria for values_allowed: must be either a list of possible values, or one of 'string', 'int', 'float'. [type=value_error, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
2024-05-10 14:46:08 [ERROR] idaes.watertap.ui.fsapi: Cannot get FlowsheetInterface object for module '<module 'watertap.examples.flowsheets.lsrro.lsrro_ui' from '/home/ludo/lbl/watertap/watertap/watertap/examples/flowsheets/lsrro/lsrro_ui.py'>': 4 validation errors for FlowsheetExport
build_options.ROFiniteElements.value
  Value error, 'value' (10) not within expected range of [20-1] [type=value_error, input_value=10, input_type=int]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
build_options.NaClSolubilityLimit.value
  Value error, bool does not match the following criteria for values_allowed: must be either a list of possible values, or one of 'string', 'int', 'float'. [type=value_error, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
build_options.ConcentrationPolarization.value
  Value error, bool does not match the following criteria for values_allowed: must be either a list of possible values, or one of 'string', 'int', 'float'. [type=value_error, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
build_options.ROPressureDrop.value
  Value error, bool does not match the following criteria for values_allowed: must be either a list of possible values, or one of 'string', 'int', 'float'. [type=value_error, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
2024-05-10 14:46:08 [ERROR] idaes.watertap.ui.fsapi: Cannot get FlowsheetInterface object for module '<module 'watertap.examples.flowsheets.lsrro.lsrro_ui' from '/home/ludo/lbl/watertap/watertap/watertap/examples/flowsheets/lsrro/lsrro_ui.py'>': 4 validation errors for FlowsheetExport
build_options.ROFiniteElements.value
  Value error, 'value' (10) not within expected range of [20-1] [type=value_error, input_value=10, input_type=int]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
build_options.NaClSolubilityLimit.value
  Value error, bool does not match the following criteria for values_allowed: must be either a list of possible values, or one of 'string', 'int', 'float'. [type=value_error, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
build_options.ConcentrationPolarization.value
  Value error, bool does not match the following criteria for values_allowed: must be either a list of possible values, or one of 'string', 'int', 'float'. [type=value_error, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error
build_options.ROPressureDrop.value
  Value error, bool does not match the following criteria for values_allowed: must be either a list of possible values, or one of 'string', 'int', 'float'. [type=value_error, input_value=True, input_type=bool]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error

Diagnosis

The cause for this is exceptions being caught and logged, whereas we should probably let these propagate up and handle the logging in clients:

https://github.com/watertap-org/watertap/blob/c2ee96cc430ee26c3899a299e24b1a0da90f9c4d/watertap/ui/fsapi.py#L1019-L1025

https://github.com/watertap-org/watertap/blob/c2ee96cc430ee26c3899a299e24b1a0da90f9c4d/watertap/ui/fsapi.py#L984-L988

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions