Skip to content

docs: mention pydot resolution settings - #514

Merged
fgmacedo merged 2 commits into
fgmacedo:developfrom
comalice:patch-1
Jan 14, 2025
Merged

fgmacedo merged 2 commits into
fgmacedo:developfrom
comalice:patch-1

Conversation

@comalice

@comalice comalice commented Jan 8, 2025

Copy link
Copy Markdown
Contributor

This PR adds mention of pydot's DPI modifier. I found the default image DPI hard to read due to missing portions of letters. Changing the DPI of the image fixes the issue for me, but I had to hunt for the functionality.

@fgmacedo fgmacedo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Nice! Thanks!

Comment thread docs/diagram.md
@sonarqubecloud

sonarqubecloud Bot commented Jan 8, 2025

Copy link
Copy Markdown

@comalice

comalice commented Jan 8, 2025

Copy link
Copy Markdown
Contributor Author

@fgmacedo, I ran into an issue related to newlines when running tests on Windows.

Here's the relevant pytest output:

――――――――――――――――――――――――――――――――――― test_machine_repr_custom_[expected_reprs0-AllActionsMachine] ―――――――――――――――――――――――――――――――――――

request = <FixtureRequest for <Function test_machine_repr_custom_[expected_reprs0-AllActionsMachine]>>
machine_name = 'AllActionsMachine'
expected_reprs = ('_repr_svg_', '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<!DOCTYPE svg')

    @pytest.mark.parametrize(
        "machine_name",
        [
            "AllActionsMachine",
            "OrderControl",
        ],
    )
    def test_machine_repr_custom_(request, machine_name, expected_reprs):
        machine_cls = request.getfixturevalue(machine_name)
        machine = machine_cls()

        magic_method, expected_repr = expected_reprs
        repr = getattr(machine, magic_method)()
>       assert repr.startswith(expected_repr)
E       assert False
E        +  where False = <built-in method startswith of str object at 0x00000237B73035D0>('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<!DOCTYPE svg')
E        +    where <built-in method startswith of str object at 0x00000237B73035D0> = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"\r\n "http://...-family="Arial" font-size="9.00">[condition_1, condition_2, !unless_1, !unless_2]</text>\r\n</g>\r\n</g>\r\n</svg>\r\n'.startswith

tests\test_contrib_diagram.py:40: AssertionError

I have a kludge-fix that strips newlines from the test strings. Is that worthy of another PR? Or are you comfortable with some failing tests on Windows? I presume your dev/testing happens on a Linux box.

@comalice
comalice requested a review from fgmacedo January 9, 2025 20:13
@fgmacedo
fgmacedo merged commit 9954890 into fgmacedo:develop Jan 14, 2025
@comalice
comalice deleted the patch-1 branch January 14, 2025 17:59
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.

2 participants