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

Fix readthedocs #318

Closed
wants to merge 10 commits into from
Closed
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
1 change: 1 addition & 0 deletions .github/workflows/glayout_opamp_sim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
$IMAGE_NAME \
bash -c "\
cp ./.github/scripts/test_glayout_ci.py ./openfasoc/generators/glayout/tapeout/tapeout_and_RL/. &&\
pip uninstall glayout -y &&\
pip3 install -r requirements.txt &&\
cd ./openfasoc/generators/glayout/tapeout/tapeout_and_RL/ &&\
pip3 install prettyprint prettyprinttree gdstk &&\
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/glayout_sky130.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
-w $PWD \
$IMAGE_NAME \
bash -c "\
pip uninstall glayout -y &&\
cp ./.github/scripts/test_glayout_ci.py ./openfasoc/generators/glayout/. &&\
cd ./openfasoc/generators/glayout &&\
pip3 install gdsfactory==7.7.0 prettyprint prettyprinttree gdstk &&\
Expand All @@ -57,6 +58,7 @@ jobs:
-w $PWD \
$IMAGE_NAME \
bash -c "\
pip uninstall glayout -y &&\
cp ./.github/scripts/test_glayout_ci.py ./openfasoc/generators/glayout/. &&\
cd ./openfasoc/generators/glayout &&\
pip3 install gdsfactory==7.7.0 prettyprint prettyprinttree gdstk &&\
Expand All @@ -76,6 +78,7 @@ jobs:
-w $PWD \
$IMAGE_NAME \
bash -c "\
pip uninstall glayout -y &&\
cp ./.github/scripts/test_glayout_ci.py ./openfasoc/generators/glayout/. &&\
cd ./openfasoc/generators/glayout &&\
pip3 install gdsfactory==7.7.0 prettyprint prettyprinttree gdstk &&\
Expand All @@ -95,6 +98,7 @@ jobs:
-w $PWD \
$IMAGE_NAME \
bash -c "\
pip uninstall glayout -y &&\
cp ./.github/scripts/test_glayout_ci.py ./openfasoc/generators/glayout/. &&\
cd ./openfasoc/generators/glayout &&\
pip3 install gdsfactory==7.7.0 prettyprint prettyprinttree gdstk &&\
Expand All @@ -114,6 +118,7 @@ jobs:
-w $PWD \
$IMAGE_NAME \
bash -c "\
pip uninstall glayout -y &&\
cp ./.github/scripts/test_glayout_ci.py ./openfasoc/generators/glayout/. &&\
cd ./openfasoc/generators/glayout &&\
pip3 install gdsfactory==7.7.0 prettyprint prettyprinttree gdstk &&\
Expand Down
5 changes: 3 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ submodules:

# Set the version of Python and other tools you might need
build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.10"
# You can also specify other tool versions:
# nodejs: "16"
# rust: "1.55"
Expand All @@ -30,3 +30,4 @@ formats: []
python:
install:
- requirements: requirements.txt
- requirements: requirements_dev.txt
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ["sphinx.ext.autosectionlabel", "nbsphinx"]
extensions = ["sphinx.ext.autosectionlabel", "nbsphinx", "sphinx_rtd_theme"]
autosectionlabel_prefix_document = True
nbsphinx_execute = "never"
# Add any paths that contain templates here, relative to this directory.
Expand All @@ -42,8 +42,8 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
import sphinx_rtd_theme, nbsphinx

# import sphinx_rtd_theme, nbsphinx

html_theme = "sphinx_rtd_theme"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from glayout.flow.placement.two_transistor_interdigitized import two_nfet_interdigitized
from glayout.flow.placement.four_transistor_interdigitized import generic_4T_interdigitzed
from glayout.flow.placement.two_transistor_interdigitized import two_pfet_interdigitized
from glayout.flow.components.diff_pair import diff_pair_generic
from glayout.flow.blocks.diff_pair import diff_pair_generic
from glayout.flow.routing.smart_route import smart_route
from glayout.flow.routing.L_route import L_route
from glayout.flow.routing.c_route import c_route
Expand Down
4 changes: 2 additions & 2 deletions openfasoc/generators/glayout/glayout/flow/pdk/mappedpdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def create_magic_commands_file(temp_dir):
dir_name = design_name
path_to_dir = path_to_regression_drc / dir_name
if not path_to_dir.exists():
path_to_dir.mkdir()
path_to_dir.mkdir(parents=True, exist_ok=False)
new_output_file_path = path_to_dir / output_file
if not new_output_file_path.exists():
shutil.copy(report_path, path_to_dir / output_file)
Expand Down Expand Up @@ -769,7 +769,7 @@ def write_spice(input_cdl, output_spice, lvs_schematic_ref_file):
dir_name = design_name
path_to_dir = Path(__file__).resolve().parents[1] / "regression" / "lvs" / dir_name
if not path_to_dir.exists():
path_to_dir.mkdir()
path_to_dir.mkdir(parents=True, exist_ok=False)
new_output_file_path = path_to_dir / output_file_path
if not new_output_file_path.exists():
shutil.copy(report_path, path_to_dir / output_file_path)
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
25 changes: 19 additions & 6 deletions openfasoc/generators/glayout/glayout/syntaxer/relational.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,24 +300,26 @@ def __init__(self, component_identifiers: list[str], component_name: str, module
# try to find an os path to the desired module by looking in Glayout
if module_path is None:
# try to resolve path of glayout package
matching_files = list(Path("./").resolve().rglob("glayout"))
if len(matching_files)>0:
glayout_path = (matching_files[0].resolve() / "flow").resolve()
matching_files = Path(__file__).resolve().parents[1]
# matching_files = list(Path("./").resolve().rglob("glayout"))
if matching_files.is_dir():
glayout_path = (matching_files.resolve() / "flow").resolve()
else:
raise FileNotFoundError("Glayout.flow package not found in a sub folder of ../ directory")
# try to resolve path of user module in Glayout package
# this will look for the file which starts with "component_name" ANYWHERE in the glayout.flow package
matching_files = list(glayout_path.rglob(str(component_name)+".py"))
matching_files += list(glayout_path.rglob(str(component_name)+"_cell.py"))
matching_files += list(glayout_path.rglob(str(component_name)+".convo"))
# also check the test_cases directory for convo files
matching_files += list((glayout_path / "../llm/syntax_data/convos").rglob(str(component_name)+".convo"))
# matching_files += list((glayout_path / "../llm/syntax_data/convos").rglob(str(component_name)+".convo"))
if len(matching_files)>0:
module_path = matching_files[-1].resolve()
else:
raise FileNotFoundError("Could not find a module called "+str(component_name)+" in Glayout")
# copy convo file into glayout Components and then create a python file and copy it into glayout components
if str(module_path).endswith(".convo"):
components_directory = glayout_path / "components"
components_directory = glayout_path / "blocks"
if module_path.parent != components_directory:
shutil.copy(module_path, components_directory)
glayoutcode = glayout.syntaxer.dynamic_load.run_session(module_path,True)
Expand Down Expand Up @@ -360,7 +362,18 @@ def from_module_import(cls, module: str, nameofobjtoimport: str):
Returns: the object that was imported
"""
module_object = import_module(module)
return getattr(module_object, nameofobjtoimport)
if module_object is None:
raise ImportError("could not import module, maybe cell's __init__.py is missing?")
try:
return getattr(module_object, nameofobjtoimport)
except AttributeError:
# Try appending "_cell" if the direct attribute fetch failed
cell_attr_name = f"{nameofobjtoimport}_cell"
try:
return getattr(module_object, cell_attr_name)
except AttributeError:
error_msg = (f"Could not find '{nameofobjtoimport}' or '{cell_attr_name}' in module '{module_object}'.")
raise AttributeError(error_msg) from None

def get_code(self) -> str:
"""returns as str a whole import line of code"""
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ numpy
matplotlib
gdsfactory==7.7.0
nbsphinx
sphinx_rtd_theme
cairosvg
scipy
ltspice
Expand Down
1 change: 1 addition & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ sphinx
sphinx-autodoc-typehints
sphinx-click
sphinx-markdown-tables
sphinx-rtd-theme
tox
xdoctest
Loading