-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: visualize list of FSWs #11
Conversation
* add function * fix workflow checks * update vertical image test
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.
great start!
.github/workflows/lint_and_test.yaml
Outdated
@@ -0,0 +1,31 @@ | |||
name: Lint and Test |
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 lint and test? when separate, they give two different information types, and when together it will first fail on lint, then test and not communicate
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.
I did not get you? do you not want check lint and test in same run? because it doesn't stop if one fails?
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.
i prefer checking them in separate runs because i would like to know the status of both.
- if test fails, i really need to fix something
- if lint fails, it can wait for the next commit. i should fix it but less rush
so having the two workflows gives me two status indicators
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.
done
signwriting/visualizer/visualize.py
Outdated
@@ -1,6 +1,8 @@ | |||
# pylint: disable=unnecessary-lambda-assignment |
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.
ideally, this should be near the affected line, otherwise in the pyproject
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.
there were 4 lines using lambda
i felt it is redundant to use it 4 time, so what do you suggest i do? in the pyproject config?
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.
either project config or next to each line
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.
done
signwriting/visualizer/visualize.py
Outdated
|
||
|
||
# pylint: disable=too-many-locals, too-many-arguments | ||
def signwritings_to_image(fsw_list: List[str], antialiasing: bool = True, trust_box: bool = True, |
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.
"signwritings" is very not elegant imo.
i think this can use the same function as the original, but when encountering a list, call layout
def signwriting_to_image(fsw: Union[str, List[str]], antialiasing=True, trust_box=True, embedded_color=False,
line_color: RGBA = (0, 0, 0, 255),
fill_color: RGBA = (255, 255, 255, 255),
direction: Literal["horizontal", "vertical"] = "horizontal") -> Image:
if isinstance(fsw, list):
images = [
signwriting_to_image(fsw_string, antialiasing, trust_box, embedded_color, line_color, fill_color)
for fsw_string in fsw_list
]
return layout_signwriting(images, direction)
.....
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.
done
signwriting/visualizer/visualize.py
Outdated
final_image.paste(img, paste_position(offset)) | ||
offset += offset_increment(img) | ||
|
||
return final_image |
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.
I do not like the output of this layout function.
See here for example https://slevinski.github.io/SuttonSignWriting/characters/index.html, Hello World example or Introduction.
When multiple signs, there are rules on how to lay them out.
I believe this is the code used for a vertical column: https://github.com/sutton-signwriting/sgnw-components/tree/master/src/components/fsw-vp
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 mean to say i should add gaps in between?
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.
and center the images in the "lane"
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.
done
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.
Great job!
convert list of fsw to image with direction support and fixed workflow tests
@AmitMY please Squash and Merge