-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert API to snake_case #60
Conversation
I'm going to prepare PR's in python-shader and visvis2 to adjust to the new API. Then I'll merge them in quick succession. |
|
||
def getSizeAndPixelRatio(self): | ||
def get_size_and_pixel_ratio(self): |
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.
do you think perhaps the entire Qt widget should have Qt style conventions? eh, it's just a little straining on the eyes :) wouldn't mind merging this as is
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.
mmm, that's a good question. I think that since the methods that we add here are part of the wgpu API (they come from an abstract base class), they should be snake_case. It actually makes it clear with what API you're interacting with. But yeah, it does not look qt-ish :/
render_pipeline = device.create_render_pipeline( | ||
layout=pipeline_layout, | ||
vertexStage={"module": vshader, "entryPoint": "main"}, | ||
fragmentStage={"module": fshader, "entryPoint": "main"}, | ||
primitiveTopology=wgpu.PrimitiveTopology.triangle_list, | ||
rasterizationState={ | ||
"frontFace": wgpu.FrontFace.ccw, | ||
"cullMode": wgpu.CullMode.none, | ||
"depthBias": 0, | ||
"depthBiasSlopeScale": 0.0, | ||
"depthBiasClamp": 0.0, | ||
vertex_stage={"module": vshader, "entry_point": "main"}, | ||
fragment_stage={"module": fshader, "entry_point": "main"}, | ||
primitive_topology=wgpu.PrimitiveTopology.triangle_list, | ||
rasterization_state={ | ||
"front_face": wgpu.FrontFace.ccw, | ||
"cull_mode": wgpu.CullMode.none, | ||
"depth_bias": 0, | ||
"depth_bias_slope_scale": 0.0, | ||
"depth_bias_clamp": 0.0, | ||
}, |
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.
Perhaps this illustrates the changes best:
- the function name is snake_case
- the direct arguments are snake_case
- the "sub-arguments" (keys of args that are dicts) are snake_case
- enums and flags are unchanged.
LGTM! |
Closes #57