Skip to content

Fix displaying resource name local_highwater. #63

@WingCode

Description

@WingCode

Copied from PsiQ/bartiq #163

Describe the bug

When we have a resource called local_highwater, when we export it to latex, for some reason the cal part gets cut.

Image

I've also seen case where it was wrong in some other way, but I couldn't reproduce it. Though it was still related to the fact that there's cal in the name, which probably needs to get escaped/sanitized somehow.

How to reproduce

Run the following in a jupyter notebook:

from qref import SchemaV1
from bartiq import compile_routine
from bartiq.integrations import routine_to_latex
from IPython.display import Math

qref_dict = {
    "name": "my_routine",
    "type": None,
    "resources": [
        {"name": "local_highwater", "type": "other", "value": "10"},
    ],
}

alias_sampling_qref = {"version": "v1", "program": qref_dict}
uncompiled_routine = SchemaV1(**alias_sampling_qref)
compiled_routine = compile_routine(uncompiled_routine)

Math(routine_to_latex(compiled_routine.to_qref()))

The routine_to_latex function is contained here

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions