Skip to content

Conversation

@RomainBaville
Copy link
Contributor

@RomainBaville RomainBaville commented Nov 17, 2025

In the context of the code refactoring, this pr aims at creating a logger for all the vtk filters and all the ParaView plugins inplemented if absent.

  • Create logger for vtk filters
  • Create logger for ParaView plugins

This pr follows the pr #181.
This pr will not uniformize the output message of these logger. It will be done in a onther pr following the issue #184

@RomainBaville RomainBaville self-assigned this Nov 17, 2025
@RomainBaville RomainBaville added type: cleanup test-geos-integration Triggers the testing of geosPythonPackages import and integration in GEOS CI type: refactor labels Nov 17, 2025
@RomainBaville RomainBaville marked this pull request as ready for review November 18, 2025 10:07
@RomainBaville RomainBaville added flag: ready for review and removed test-geos-integration Triggers the testing of geosPythonPackages import and integration in GEOS CI labels Nov 18, 2025
@RomainBaville RomainBaville changed the base branch from main to RomainBaville/refactor/RefactorFilterWithoutVTKPythonAlgorytmBase November 20, 2025 10:18
@RomainBaville RomainBaville added DO NOT MERGE! test-geos-integration Triggers the testing of geosPythonPackages import and integration in GEOS CI labels Nov 21, 2025
Copy link
Contributor

@jafranc jafranc left a comment

Choose a reason for hiding this comment

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

I think the try-except block there is some refactoring

Comment on lines +44 to +54


class RaiseMergeBlocks( TestCase ):
"""Test failure on empty multiBlockDataSet."""

def test_TypeError( self ) -> None:
"""Test raise of TypeError."""
multiBlockDataset = vtkMultiBlockDataSet() # should fail on empty data
if Version( vtk.__version__ ) < Version( "9.5" ):
with pytest.raises( VTKError ):
multiblockModifiers.mergeBlocks( multiBlockDataset, True )
Copy link
Contributor

Choose a reason for hiding this comment

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

why in this PR ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I changed the filter MergeBlockEnhanced, its test needed to be change to, this test was usless with the new implementation of the filter so I move it to the test of the function mergeBlock

f"The { self.piece } attributes { attributesAlreadyInMeshTo } are already present in the final mesh." )
self.logger.error( f"The filter { self.logger.name } failed." )
return False
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure of try except and raise in the try.
Raising here is fine but capturing should be done in the caller or caller's caller tbf

Copy link
Contributor

Choose a reason for hiding this comment

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

see here

Copy link
Contributor Author

@RomainBaville RomainBaville Nov 24, 2025

Choose a reason for hiding this comment

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

In this pr I wanted to add or update the logger. To do that I used the same scheme try/except in all the plugins and filters. But your are right, the filtre may not use try/except. To keep "small" and "unitary" pr, I think it can be done in another pr (see pr #185 )

self.logger.error( f"The new attribute { self.newAttributeName } has not been added." )
self.logger.error( f"The filter { self.logger.name } failed." )
return False
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Base automatically changed from RomainBaville/refactor/RefactorFilterWithoutVTKPythonAlgorytmBase to main November 25, 2025 09:21
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: cleanup type: refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants