Skip to content

fix: Add an error counter to stop workflow if one step failed#231

Open
RomainBaville wants to merge 6 commits intomainfrom
RomainBaville/fix/FixGeomechanicsWorkflow
Open

fix: Add an error counter to stop workflow if one step failed#231
RomainBaville wants to merge 6 commits intomainfrom
RomainBaville/fix/FixGeomechanicsWorkflow

Conversation

@RomainBaville
Copy link
Contributor

@RomainBaville RomainBaville commented Feb 19, 2026

For a ParaView plugin of geos-pv the error managment is as follow:

  • filters called by the plugin raises error
  • the plugin logs them with the verbosity error

If a plugin "a" calls another plugin "b", even if an error is raised during the call of the plugin "b", the plugin "a" raises no error and doesn't stop.

This PR features the renaming of the handler "CountWarningsHandler" to "CountVerbosityHandler". It will now count warnings, errors and higher verbosity as well (e.g. critical error).
Using this counter, the plugin "b" will save the number of error logged and the plugin "a" can get it at the end of the application of the plugin "b".

This PR close #233

@RomainBaville RomainBaville self-assigned this Feb 19, 2026
@RomainBaville RomainBaville added type: bug test-geos-integration Triggers the testing of geosPythonPackages import and integration in GEOS CI labels Feb 19, 2026
@RomainBaville RomainBaville marked this pull request as ready for review February 20, 2026 16:19
Copy link
Collaborator

@paloma-martinez paloma-martinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me :)

Just a few typos to fix

else:
self.logger.info( f"{ result }." )

# Keep number of warnings logged during the filter application and reset the warnings count in case the filter is apply again.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Keep number of warnings logged during the filter application and reset the warnings count in case the filter is apply again.
# Keep number of warnings logged during the filter application and reset the warnings count in case the filter is applied again.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please correct it in all the files :)

"""Compute Geomechanical properties on input surface.

Raises:
TypeError: Error With the type of the input mesh.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TypeError: Error With the type of the input mesh.
TypeError: Error with the type of the input mesh.

npt.NDArray[np.float64]: Vector of new coordinates of the attribute.

Raises:
ValueError: Error with the shape of attrArray or the computation of the attribute coordinate.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ValueError: Error with the shape of attrArray or the computation of the attribute coordinate.
ValueError: Error with the shape of attrArray or the computation of the attribute coordinates.


if not np.any( np.isfinite( attrXYZ ) ):
self.logger.error( "Attribute new coordinate calculation failed." )
raise ValueError( "Attribute new coordinate calculation failed." )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
raise ValueError( "Attribute new coordinate calculation failed." )
raise ValueError( "Attribute new coordinates calculation failed." )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flag: ready for review test-geos-integration Triggers the testing of geosPythonPackages import and integration in GEOS CI type: bug type: cleanup type: refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update the CountHandler to count error as well

2 participants