Skip to content

Commit

Permalink
FEAT: Automated full testing including examples
Browse files Browse the repository at this point in the history
  • Loading branch information
daquintero committed Aug 9, 2023
1 parent 4de60cf commit 0047dca
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
4 changes: 2 additions & 2 deletions docs/examples/03_sax_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import piel
import sax

gf.components()
dir(gf.components)

# We create a balanced MZI lattice full of the same `mzi2x2_2x2` components to demonstrate `sax` network basics.

Expand Down Expand Up @@ -102,7 +102,7 @@

# `piel` provides a library with a list of models, that we hope we can extend and improve with your contribution! We create our model dictionary accordingly based on our default photonic frequency library:

piel.models.frequency.photonic.get_default_models()
piel.models.frequency.get_default_models()

# Let's explore one of our default models. Each model has its source in the documentation.

Expand Down
19 changes: 10 additions & 9 deletions docs/examples/designs/simple_design/simple_design/tb/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash
# Makefile
SIM ?= icarus
TOPLEVEL_LANG ?= verilog
VERILOG_SOURCES += /foss/designs/piel/docs/examples/designs/simple_design/simple_design/src/adder.vhdl
VERILOG_SOURCES += /foss/designs/piel/docs/examples/designs/simple_design/simple_design/src/adder.sv
TOPLEVEL := adder
MODULE := test_adder
include $(shell cocotb-config --makefiles)/Makefile.sim
#!/bin/bash
# Makefile
SIM ?= icarus
TOPLEVEL_LANG ?= verilog
VERILOG_SOURCES += C:\Users\dario\Documents\phd\piel\docs\examples\designs\simple_design\simple_design\src\.ipynb_checkpoints
VERILOG_SOURCES += C:\Users\dario\Documents\phd\piel\docs\examples\designs\simple_design\simple_design\src\adder.sv
VERILOG_SOURCES += C:\Users\dario\Documents\phd\piel\docs\examples\designs\simple_design\simple_design\src\adder.vhdl
TOPLEVEL := adder
MODULE := test_adder
include $(shell cocotb-config --makefiles)/Makefile.sim
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cd /foss/designs/piel/docs/examples/designs/simple_design/simple_design/tb;
make
cd C:\Users\dario\Documents\phd\piel\docs\examples\designs\simple_design\simple_design\tb;
make
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
python_files = test_*.py 0*.py
2 changes: 1 addition & 1 deletion tests/test_piel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from click.testing import CliRunner

from piel import piel
import piel # NOQA: F401
from piel import cli


Expand Down
6 changes: 3 additions & 3 deletions tests/visual/test_data_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

print(test_data)

piel.append_row_to_dict(data=test_data, copy_index=1, set_value={"t": 10})
piel.visual.append_row_to_dict(data=test_data, copy_index=1, set_value={"t": 10})
print(test_data)

"""
Expand All @@ -20,7 +20,7 @@

test_data = {"t": np.array([3000, 4000, 5000, 6000]), "x": np.array([2, 3, 4, 5])}

out_data = piel.points_to_lines_fixed_transient(
out_data = piel.visual.points_to_lines_fixed_transient(
data=test_data,
time_index_name="t",
fixed_transient_time=1,
Expand Down Expand Up @@ -316,7 +316,7 @@

print(test_data["t"])

piel.points_to_lines_fixed_transient(
piel.visual.points_to_lines_fixed_transient(
data=test_data,
time_index_name="t",
fixed_transient_time=1,
Expand Down

0 comments on commit 0047dca

Please sign in to comment.