-
Notifications
You must be signed in to change notification settings - Fork 9
Conversation
…s_view2 into example-files
I went through Cannot load backend 'Qt5Agg' which requires the 'qt5' interactive framework, as 'headless' is currently running Looks like an error unrelated to my change. Maybe need help from @Licini |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some initial feedbacks here and there, could you rebase
this branch on the latest main, so that the file change history of example-files don't get mixed in ?
A quick tutorial here:
https://www.youtube.com/watch?v=_UZEXUrj-Ds
PS: a general advice is that this PR is too large, I understand it is difficult for structural changes like this, in the future plz break it down as much as you can, a rule of thumb is to make each PR under 10 files (for non-repetitive edits).
src/compas_view2/__init__.py
Outdated
@@ -1,10 +1,12 @@ | |||
import os | |||
from .helpers import * # noqa: F401, F403 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need this here. And it is the reason is the test failed
src/compas_view2/__init__.py
Outdated
@@ -35,4 +37,4 @@ def new_util_find_library(name): | |||
util.find_library = new_util_find_library | |||
|
|||
|
|||
__all__ = ["HOME", "DATA", "DOCS", "TEMP", "DATA_OBJECT", "register"] | |||
__all__ = ["HOME", "DATA", "DOCS", "TEMP", "DATA_OBJECT", "register"] # noqa: F405 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this added?
src/compas_view2/helpers/__init__.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate a bit what does helper folder do? (we can discuss in person if too much to write)
src/compas_view2/app/app.py
Outdated
@@ -16,6 +14,8 @@ | |||
|
|||
from functools import partial | |||
|
|||
from typing import Literal, Tuple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move it up and keep it consistent with previous import?
src/compas_view2/app/app.py
Outdated
if title: | ||
config["app"]["title"] = title | ||
if version: | ||
config["app"]["version"] = version | ||
if width: | ||
config["app"]["width"] = width | ||
if height: | ||
config["app"]["height"] = height | ||
|
||
if viewmode: | ||
config["view"]["viewmode"] = viewmode | ||
if show_grid: | ||
config["view"]["show_grid"] = show_grid | ||
|
||
if enable_sidebar: | ||
config["sidebar"]["enable_sidebar"] = enable_sidebar | ||
|
||
if enable_sidedock1: | ||
config["sidedocks"]["enable_sidedock1"] = enable_sidedock1 | ||
if enable_sidedock2: | ||
config["sidedocks"]["enable_sidedock2"] = enable_sidedock2 | ||
if enable_sceneform: | ||
config["sidedocks"]["enable_sceneform"] = enable_sceneform | ||
if enable_propertyform: | ||
config["sidedocks"]["enable_propertyform"] = enable_propertyform | ||
|
||
if show_flow: | ||
config["flow"]["show_flow"] = show_flow | ||
if flow_view_size: | ||
config["app"]["flow_view_size"] = flow_view_size | ||
if flow_auto_update: | ||
config["app"]["flow_auto_update"] = flow_auto_update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is safer to use if xxx is not None:
src/compas_view2/actions/__init__.py
Outdated
from .view_capture import ViewCapture # noqa : F401 | ||
|
||
|
||
def mouse_key_check(event, key_status: Dict, mouse_key: Dict): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions should be move to a file, like checks.py
src/compas_view2/actions/action.py
Outdated
from qtpy import QtCore | ||
|
||
|
||
def supported_keys(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not directly a variable like SUPPORTED_KEYS = {...}
instated of function?
data/rst_generator.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I think about this, this file should be in scriptes/
, and all example files currently there should be moved to a new folder called examples/
, but let's make that a separate PR later
Aha, then this should be good @Licini . My fork is up-to-date now. |
close since it has been separately integrated |
CHANGELOG
scripts
folder as it is duplicated with theexamples
folder, and the other COMPAS packages do not contain this folder.example_custom_keys.py
in the examples/control.Tutorial Software Concepts
section in the documentation.Tutorial Configuration
section in the documentation.Action
class which controls all the key actions.Checklist
CHANGELOG.md
file in theUnreleased
section under the most fitting heading (e.g.Added
,Changed
,Removed
).invoke test
).invoke lint
).compas.datastructures.Mesh
.Quick Description
Key customization possible.
All the settings are configuration-based.
Diagrams and new examples for the documentation.
Have a good weekend :)