Skip to content

Maintenance pre-commit and picture#108

Open
UlysseDurand wants to merge 13 commits into
Kitware:masterfrom
UlysseDurand:maintenance
Open

Maintenance pre-commit and picture#108
UlysseDurand wants to merge 13 commits into
Kitware:masterfrom
UlysseDurand:maintenance

Conversation

@UlysseDurand
Copy link
Copy Markdown

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
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

@export_rpc("viewport.axes.orientation.visibility.update")
def update_orientation_axes_visibility(self, view_id, show_axis):
def update_orientation_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 this change of name?

Copy link
Copy Markdown
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.


@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
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.

dataset_id,
context,
_depth,
_requested_fields,
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.

keep the original name for kwarg usage.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

If I understood well, in UlysseDurand@b6ebad5, I reverted to requested_fields variable name, and added a noqa for unused variable name

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
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
- 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.

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.

3 participants