Skip to content

Commit

Permalink
Merge pull request #3117 from gdsfactory/update_numpy
Browse files Browse the repository at this point in the history
update numpy
  • Loading branch information
joamatab authored Aug 12, 2024
2 parents 6f7254e + e2f7e55 commit 986f5bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
14 changes: 4 additions & 10 deletions gdsfactory/labels/get_test_manifest.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
"""Converts CSV of test site labels into a CSV test manifest."""

import pandas as pd

import gdsfactory as gf
from gdsfactory.samples.sample_reticle import sample_reticle


def get_test_manifest(
component: gf.Component, one_setting_per_column: bool = True
) -> pd.DataFrame:
def get_test_manifest(component: gf.Component, one_setting_per_column: bool = True):
"""Returns a pandas DataFrame with test manifest.
Args:
component: Component to extract test manifest from.
one_setting_per_column: If True, puts each cell setting in a separate column.
"""
import pandas as pd

rows = []
ports = component.get_ports_list()
name_to_settings = {}

for port in ports:
instance_name = port.name
name_to_settings[instance_name] = port.info
name_to_settings = {port.name: port.info for port in ports}

if one_setting_per_column:
# Gather all unique settings keys
Expand Down
6 changes: 3 additions & 3 deletions gdsfactory/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def append(self, path):
and np.issubdtype(np.array(path).dtype, np.number)
and (np.shape(path)[1] == 2)
):
points = np.asfarray(path)
points = np.asarray(path, dtype=float)
nx1, ny1 = points[1] - points[0]
start_angle = np.arctan2(ny1, nx1) / np.pi * 180
nx2, ny2 = points[-1] - points[-2]
Expand Down Expand Up @@ -1426,7 +1426,7 @@ def euler(
dx = xp - Rp * np.sin(p * alpha / 2)
dy = yp - Rp * (1 - np.cos(p * alpha / 2))
else:
xbend1 = ybend1 = np.asfarray([])
xbend1 = ybend1 = np.asarray([], dtype=float)
dx = 0
dy = 0

Expand Down Expand Up @@ -1523,7 +1523,7 @@ def spiral_archimedean(


def _compute_segments(points):
points = np.asfarray(points)
points = np.asarray(points, dtype=float)
normals = np.diff(points, axis=0)
normals = (normals.T / np.linalg.norm(normals, axis=1)).T
dx = np.diff(points[:, 0])
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ dependencies = [
"jinja2<4",
"loguru<1",
"matplotlib<4",
"numpy<2",
"numpy",
"orjson<4",
"pandas<3",
"pandas",
"pydantic>=2.6,<2.9",
"pydantic-settings<3",
"pydantic-extra-types<3",
Expand Down

0 comments on commit 986f5bf

Please sign in to comment.