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

docs: Add Deprecated names of variables #574

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/_templates/generate_configvar_docs/common_pdk_vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ ${"##"} PDK-Level
These are variables that affect the entire PDK.


| Variable Name | Type | Description | Units |
| - | - | - | - |
| Variable Name | Type | Description | Units | Deprecated Names |
| - | - | - | - | - |
%for var in pdk_variables:
| `${var.name}`{#${var._get_docs_identifier()}} | ${var.type_repr_md(for_document=True)} | ${var.desc_repr_md()} | ${var.units or ""} |
| `${var.name}`{#${var._get_docs_identifier()}} | ${var.type_repr_md(for_document=True)} | ${var.desc_repr_md()} | ${var.units or ""} | ${var.get_deprecated_names_md()|join("<br>")} |
Copy link
Member

Choose a reason for hiding this comment

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

This BR appears to be breaking everything

Screenshot 2024-10-09 at 13 51 05

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Where is that? The table renders fine in readthedocs.

%endfor

(univ_flow_cvars_scl)=
${"##"} SCL-Level

These are variables that affect a specific standard-cell library.

| Variable Name | Type | Description | Units |
| - | - | - | - |
| Variable Name | Type | Description | Units | Deprecated Names |
| - | - | - | - | - |
%for var in scl_variables:
| `${var.name}`{#${var._get_docs_identifier()}} | ${var.type_repr_md(for_document=True)} | ${var.desc_repr_md()} | ${var.units or ""} |
| `${var.name}`{#${var._get_docs_identifier()}} | ${var.type_repr_md(for_document=True)} | ${var.desc_repr_md()} | ${var.units or ""} | ${var.get_deprecated_names_md()|join("<br>")} |
Copy link
Member

Choose a reason for hiding this comment

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

ditto

%endfor
6 changes: 3 additions & 3 deletions docs/_templates/generate_configvar_docs/common_vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ can freely override these values.
optional and behave accordingly.
```

| Variable Name | Type | Description | Default | Units |
| - | - | - | - | - |
| Variable Name | Type | Description | Default | Units | Deprecated Names |
| - | - | - | - | - | - |
%for var in option_variables:
| [`${var.name}`]{#${var._get_docs_identifier()}} | ${var.type_repr_md(for_document=True)} | ${var.desc_repr_md()} | `${var.default}` | ${var.units or ""} |
| [`${var.name}`]{#${var._get_docs_identifier()}} | ${var.type_repr_md(for_document=True)} | ${var.desc_repr_md()} | `${var.default}` | ${var.units or ""} | ${var.get_deprecated_names_md()|join("<br>")} |
Copy link
Member

Choose a reason for hiding this comment

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

ditto

%endfor
2 changes: 1 addition & 1 deletion docs/source/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## General

(faq-whats-openlane=)
(faq-whats-openlane)=

### What is OpenLane?

Expand Down
10 changes: 9 additions & 1 deletion openlane/config/variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,14 @@ def type_repr_md(self, for_document: bool = False) -> str: # pragma: no cover
return repr_type(self.type).replace("|", "|<br />")
return repr_type(self.type)

def get_deprecated_names_md(self) -> List[str]:
deprecated_names_md = []
for deprecated_name in self.deprecated_names:
if not isinstance(deprecated_name, str):
deprecated_name, _ = deprecated_name
deprecated_names_md.append(f"`{deprecated_name}`")
return deprecated_names_md

def desc_repr_md(self) -> str: # pragma: no cover
"""
:returns: The description, but with newlines escaped for Markdown.
Expand Down Expand Up @@ -710,7 +718,7 @@ def _get_docs_identifier(self, parent: Optional[str] = None) -> str:
return identifier

def __hash__(self) -> int:
return hash((self.name, self.type, self.default))
return hash((self.name, str(self.type), str(self.default)))

def __eq__(self, rhs: object) -> bool:
if not isinstance(rhs, Variable):
Expand Down
6 changes: 3 additions & 3 deletions openlane/flows/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,14 +419,14 @@ def get_help_md(Self) -> str: # pragma: no cover

#### Flow-specific Configuration Variables

| Variable Name | Type | Description | Default | Units |
| - | - | - | - | - |
| Variable Name | Type | Description | Default | Units | Deprecated Names |
| - | - | - | - | - | - |
"""
)
for var in flow_config_vars:
units = var.units or ""
pdk_superscript = "<sup>PDK</sup>" if var.pdk else ""
result += f"| `{var.name}`{{#{var._get_docs_identifier(Self.__name__)}}}{pdk_superscript} | {var.type_repr_md()} | {var.desc_repr_md()} | `{var.default}` | {units} |\n"
result += f"| `{var.name}`{{#{var._get_docs_identifier(Self.__name__)}}}{pdk_superscript} | {var.type_repr_md()} | {var.desc_repr_md()} | `{var.default}` | {units} | {'<br>'.join(var.get_deprecated_names_md())} |\n"
Copy link
Member

Choose a reason for hiding this comment

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

ditto

result += "\n"

if len(Self.Steps):
Expand Down
8 changes: 4 additions & 4 deletions openlane/steps/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,14 +678,14 @@ def get_help_md(
({Self.id.lower()}-configuration-variables)=
#### Configuration Variables

| Variable Name | Type | Description | Default | Units |
| - | - | - | - | - |
| Variable Name | Type | Description | Default | Units | Deprecated Names |
| - | - | - | - | - | - |
"""
)
for var in Self.config_vars:
for var in set(Self.config_vars):
units = var.units or ""
pdk_superscript = "<sup>PDK</sup>" if var.pdk else ""
result += f"| `{var.name}`{{#{var._get_docs_identifier(Self.id)}}}{pdk_superscript} | {var.type_repr_md(for_document=True)} | {var.desc_repr_md()} | `{var.default}` | {units} |\n"
result += f"| `{var.name}`{{#{var._get_docs_identifier(Self.id)}}}{pdk_superscript} | {var.type_repr_md(for_document=True)} | {var.desc_repr_md()} | `{var.default}` | {units} | {'<br>'.join(var.get_deprecated_names_md())} |\n"
Copy link
Member

Choose a reason for hiding this comment

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

ditto

result += "\n"

result = (
Expand Down
Loading