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

Missing 1.0 API pages due to class alias #814

Closed
Tracked by #479
Eric-Arellano opened this issue Feb 14, 2024 · 1 comment
Closed
Tracked by #479

Missing 1.0 API pages due to class alias #814

Eric-Arellano opened this issue Feb 14, 2024 · 1 comment

Comments

@Eric-Arellano
Copy link
Collaborator

Eric-Arellano commented Feb 14, 2024

The files qiskit.primitives.BaseEstimator and qiskit.primitives.BaseSampler are not being created in Qiskit 1.0 docs even though the HTML files exist in the Sphinx output uploaded to Box.

--

What's happening is that the HTML is really short and being classified as an attribute:

Screenshot 2024-02-14 at 6 21 15 PM

This is the HTML:

<section id="basesampler">
   <h1>BaseSampler<a class="headerlink" href="#basesampler" title="Permalink to this heading"></a></h1>
   <dl class="py attribute">
      <dt class="sig sig-object py" id="qiskit.primitives.BaseSampler">
         <span class="sig-prename descclassname"><span class="pre">qiskit.primitives.</span></span><span class="sig-name descname"><span class="pre">BaseSampler</span></span><a class="headerlink" href="#qiskit.primitives.BaseSampler" title="Permalink to this definition"></a>
      </dt>
      <dd>
         <p>alias of <code class="xref py py-class docutils literal notranslate"><span class="pre">BaseSamplerV1</span></code></p>
      </dd>
   </dl>
</section>

This code then returns this result, viewing it as an attribute API type:

for (const file of files) {
const html = await readFile(join(htmlPath, file), "utf-8");
const result = await sphinxHtmlToMarkdown({

{
  markdown: '<span id="baseestimator" />\n\n# BaseEstimator\n\nalias of `BaseEstimatorV1`\n',
  meta: { apiType: 'attribute', apiName: 'qiskit.primitives.BaseEstimator' },
  images: [],
  isReleaseNotes: false
}

That then gets removed due to this line that tries to inline the attribute into the non-existent class file for qiskit.primitives.BaseEstimator:

results = await mergeClassMembers(results);

If you comment out that line, we generate this file:

---
title: BaseSampler
description: API reference for qiskit.primitives.BaseSampler
in_page_toc_min_heading_level: 1
python_api_type: attribute
python_api_name: qiskit.primitives.BaseSampler
---

# BaseSampler

alias of `BaseSamplerV1`

I think there are two things we should do:

  1. Update Qiskit 1.0 to include BaseSamplerV1 and BaseEstimatorV1 in their API docs. That way, we'll have their full class page, and then the pages for BaseSampler will link to the BaseSamplerV1 properly.
  2. Fix our API generation script to handle this situation. We can't get rid of mergeClassMembers because it's necessary for historical API docs. Instead, we should change its logic to recognize this edge case. Maybe look if the attribute starts with the string "alias of" & check that there is no corresponding class page?
@Eric-Arellano Eric-Arellano self-assigned this Feb 14, 2024
@Eric-Arellano Eric-Arellano moved this to In Progress in Docs Planning Feb 14, 2024
@Eric-Arellano Eric-Arellano added this to the 24-02-15 Qiskit 1.0 milestone Feb 14, 2024
@Eric-Arellano Eric-Arellano changed the title Missing 1.0 API pages Missing 1.0 API pages due to class alias Feb 14, 2024
github-merge-queue bot pushed a commit that referenced this issue Feb 15, 2024
Part of #814. We shouldn't
be deleting attribute pages if they don't correspond to an owning class.

This PR also runs `npm run regen-apis`; as shown, this PR's logic change
only impacts Qiskit v1 docs.
@Eric-Arellano
Copy link
Collaborator Author

Closed by #814. Qiskit has a PR up to add the missing BaseEstimatorV1 page.

@github-project-automation github-project-automation bot moved this from In Progress to Done in Docs Planning Feb 15, 2024
frankharkins pushed a commit to frankharkins/documentation that referenced this issue Jul 22, 2024
Part of Qiskit#814. We shouldn't
be deleting attribute pages if they don't correspond to an owning class.

This PR also runs `npm run regen-apis`; as shown, this PR's logic change
only impacts Qiskit v1 docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

1 participant