Skip to content

Maintenance pre-commit and picture#108

Merged
finetjul merged 13 commits into
Kitware:masterfrom
UlysseDurand:maintenance
Jun 2, 2026
Merged

Maintenance pre-commit and picture#108
finetjul merged 13 commits into
Kitware:masterfrom
UlysseDurand:maintenance

Conversation

@UlysseDurand

Copy link
Copy Markdown
Contributor

As requested in Kitware/trame#842

  • pre-commit:
    Added same pre-commit rules as in the cookiecutter

  • picture:
    Added picture from the documentation

In Kitware/trame#842 the Web versioning isn't checked when it was added in
c9463ef

Comment thread .pre-commit-config.yaml Outdated
Comment thread .pre-commit-config.yaml
@bourdaisj

Copy link
Copy Markdown
Contributor

@jourdain Based on what you said in your comments, should we also update the cookiecutter? see cookiecutter pre-commit

@jourdain

Copy link
Copy Markdown
Collaborator

yes we should

@UlysseDurand

Copy link
Copy Markdown
Contributor Author

My mistake last time I didn't update the pyproject.toml which drives the pre-commit checks. I spent some time doing it and changing all the files for them to match the ruff formatting: 146b233.

Comment thread CHANGELOG.md
Comment thread .flake8 Outdated
Comment thread , Outdated
Comment thread tests/test_import.py Outdated
Comment thread tests/requirements.txt Outdated
Comment thread src/trame_vtk/tools/static_viewer.html
Comment thread src/trame_vtk/modules/vtk/serializers/mesh.py Outdated
Comment thread src/trame_vtk/modules/vtk/serializers/mesh.py Outdated
Comment thread src/trame_vtk/modules/vtk/protocols/mouse_handler.py
UlysseDurand added a commit to UlysseDurand/trame-vtk that referenced this pull request Apr 20, 2026
UlysseDurand added a commit to UlysseDurand/trame-vtk that referenced this pull request Apr 20, 2026
- Remove .flake8 file
- Right noqa codes for test_import.py
- Revert and ignore static_viewer.html from prettier

Ref: Kitware#108 (comment)
Ref: Kitware#108 (comment)
Ref: Kitware#108 (comment)
UlysseDurand added a commit to UlysseDurand/trame-vtk that referenced this pull request Apr 20, 2026
Comment thread src/trame_vtk/modules/vtk/protocols/view_port.py Outdated

@export_rpc("viewport.axes.center.visibility.update")
def update_center_axes_visibility(self, view_id, show_axis):
def update_center_axes_visibility(self, view_id, _depth):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why about that change of name?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My mistake, it comes from a bad "find and replace" I did.
This UlysseDurand@77fa173 puts _show_axis.

Comment thread src/trame_vtk/modules/vtk/serializers/data.py Outdated
CONVERT_LUT = False
SKIP_LIGHT = False

class LUTConfig:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Where is that coming from?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I had these pre-commit errors that indicate that no global should be used

https://docs.astral.sh/ruff/rules/global-statement^[\PLW0603^[\ Using the global statement to update `CONVERT_LUT` is discouraged
  --> src/trame_vtk/modules/vtk/serializers/initialize.py:40:12
   |
39 | def encode_lut(value=True):
40 |     global CONVERT_LUT
   |            ^^^^^^^^^^^
 |     CONVERT_LUT = value
   |

https://docs.astral.sh/ruff/rules/global-statement^[\PLW0603^[\ Using the global statement to update `SKIP_LIGHT` is discouraged
  --> src/trame_vtk/modules/vtk/serializers/initialize.py:45:12
   |
44 | def skip_light(value=True):
45 |     global SKIP_LIGHT
   |            ^^^^^^^^^^
46 |     SKIP_LIGHT = value
   |

https://docs.astral.sh/ruff/rules/global-variable-not-assigned^[\PLW0602^[\ Using global for `CONVERT_LUT` but no assignment is done
  --> src/trame_vtk/modules/vtk/serializers/initialize.py:50:12
   |
49 | def lookup_table_serializer_selector(*args, **kwargs):
50 |     global CONVERT_LUT
   |            ^^^^^^^^^^^
 |     if CONVERT_LUT:
52 |         return lookup_table_serializer2(*args, **kwargs)

Comment thread src/trame_vtk/modules/vtk/serializers/mesh.py Outdated
Comment thread src/trame_vtk/modules/vtk/serializers/mesh.py
Comment thread src/trame_vtk/modules/vtk/widget.py Outdated
UlysseDurand added a commit to UlysseDurand/trame-vtk that referenced this pull request Apr 27, 2026
UlysseDurand added a commit to UlysseDurand/trame-vtk that referenced this pull request Apr 27, 2026
- Revert variable name for kwarg usage (add noqa ARG001) in imagedata
  serializer
- Handle None data array in mesh serialization
- Change import order

Ref: Kitware#108 (comment)
Ref: Kitware#108 (comment)
Ref: Kitware#108 (comment)
Ref: Kitware#108 (comment)
@jourdain

Copy link
Copy Markdown
Collaborator

LGTM, but you need to resolve conflicts.

- Remove .flake8 file
- Right noqa codes for test_import.py
- Revert and ignore static_viewer.html from prettier

Ref: Kitware#108 (comment)
Ref: Kitware#108 (comment)
Ref: Kitware#108 (comment)
- Revert variable name for kwarg usage (add noqa ARG001) in imagedata
  serializer
- Handle None data array in mesh serialization
- Change import order

Ref: Kitware#108 (comment)
Ref: Kitware#108 (comment)
Ref: Kitware#108 (comment)
Ref: Kitware#108 (comment)
@UlysseDurand

Copy link
Copy Markdown
Contributor Author

Sorry I pushed without checking if tests pass locally (they don't), I will put a comment when the PR is ready for review again

@UlysseDurand

Copy link
Copy Markdown
Contributor Author

Tests seem to pass locally (not thanks to my last commit, I made a mistake running them before), it is ready for review

@finetjul finetjul merged commit 4104219 into Kitware:master Jun 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants