Skip to content
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

Attributes with incomplete signatures for some versions of qiskit #1217

Closed
Tracked by #479
arnaucasau opened this issue Apr 19, 2024 · 2 comments · Fixed by #1291
Closed
Tracked by #479

Attributes with incomplete signatures for some versions of qiskit #1217

arnaucasau opened this issue Apr 19, 2024 · 2 comments · Fixed by #1291

Comments

@arnaucasau
Copy link
Collaborator

There are some attributes in the qiskit API docs with incomplete signatures. We can find two examples in qiskit 0.19 at BaseSchema and FlowController.

For the former, we can see how the attribute TYPE_MAPPING and opts don't have a correct default value:

Captura desde 2024-04-19 22-59-31

These attributes seem to correspond to the Schema class of the marshmallow library (search for TYPE_MAPPING on this page). In the next screenshot we can see how the signature would look like without processing it with a unified plugin like in the API generation script and instead using $child.text():

Captura desde 2024-04-18 14-33-02

In the previous screenshot we can see also one attribute from the FlowController class which in some versions like 0.40, has that exact value:

Captura desde 2024-04-19 23-25-42

We should figure out why sometimes these signatures are incomplete for some versions. One solution to explore would be to remove the unified plugin used in generateApiComponents.ts and replace it with $child.text(), making sure we espace the apostrophes and double quotes symbols of the signature.

@Eric-Arellano
Copy link
Collaborator

@arnaucasau this can be fixed by manually fixing the HTML as part of #1252, right? If so, can you please close this as "not planned"?

@arnaucasau
Copy link
Collaborator Author

arnaucasau commented May 3, 2024

I think we can maybe fix both issues by only changing our script and not the HTML. The result simplifies the script instead of making it more complex. I created a draft PR with a possible fix here.

github-merge-queue bot pushed a commit that referenced this issue May 3, 2024
This PR removes the signature prop from the Attribute component and
instead, sets `attributeTypeHint` and `attributeValue`. This change
simplifies the script that was using different props for attributes
embedded in the class page and the rest.

As a side effect, this PR also fixes an issue with some default values
not showing correctly. These values were treated as signatures and
wrongly converted into HTML by a unified plugin.

Closes #1217 #1252
frankharkins pushed a commit to frankharkins/documentation that referenced this issue Jul 22, 2024
This PR removes the signature prop from the Attribute component and
instead, sets `attributeTypeHint` and `attributeValue`. This change
simplifies the script that was using different props for attributes
embedded in the class page and the rest.

As a side effect, this PR also fixes an issue with some default values
not showing correctly. These values were treated as signatures and
wrongly converted into HTML by a unified plugin.

Closes Qiskit#1217 Qiskit#1252
@javabster javabster removed this from Docs Planning Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants