Skip to content

Commit

Permalink
fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
joamatab committed Mar 5, 2024
1 parent a594ffb commit da93148
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 73 deletions.
12 changes: 0 additions & 12 deletions .bumpversion.cfg

This file was deleted.

68 changes: 59 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,72 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 9260cbc9c84c06022993bfbcc42fdbf0305c5b8e
rev: "9260cbc9c84c06022993bfbcc42fdbf0305c5b8e"
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: name-tests-test
args: ["--pytest-test-first"]
- id: trailing-whitespace
- id: requirements-txt-fixer

- repo: https://github.com/psf/black
rev: 25d886f52c2bbbb58386ac8050f4e67952507bc7
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.7"
hooks:
- id: black
- id: ruff
- id: ruff-format

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "6a0ba1854991b693612486cc84a2254de82d071d"
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: 953faa6870f6663ac0121ab4a800f1ce76bca31f
hooks:
- id: ruff
- id: shellcheck

# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: "v1.0.1"
# hooks:
# - id: mypy
# exclude: ^(docs/|example-plugin/|tests/fixtures)
# additional_dependencies:
# - "pydantic"

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.10.0
rev: d2425a62376c2197448cce2f825d5a0c3926b862
hooks:
- id: pretty-format-toml
args: [--autofix]

# - repo: https://github.com/aristanetworks/j2lint.git
# rev: 742a25ef5da996b9762f167ebae9bc8223e8382e
# hooks:
# - id: j2lint
# types: [file]
# files: \.(j2|yml|yaml)$
# args: [--extensions, "j2,yml,yaml", --ignore, jinja-statements-delimiter, jinja-statements-indentation, --]
# exclude: .github/.*
- repo: https://github.com/codespell-project/codespell
rev: 38bc4a97f6e22827e86526148efa38f1044a97f8
hooks:
- id: codespell
additional_dependencies:
- tomli

# - repo: https://github.com/kynan/nbstripout
# rev: e4c5b4dcbab4afa0b88b7a9243db42b1a8d95dde
# hooks:
# - id: nbstripout
# files: ".ipynb"
# - repo: https://github.com/pre-commit/pygrep-hooks
# rev: 7b4409161486c6956bb3206ce96db5d56731b1b9 # Use the ref you want to point at
# hooks:
# - id: python-use-type-annotations
# - repo: https://github.com/PyCQA/bandit
# rev: fe1361fdcc274850d4099885a802f2c9f28aca08
# hooks:
# - id: bandit
# args: [--exit-zero]
# # ignore all tests, not just tests data
# exclude: ^tests/
2 changes: 1 addition & 1 deletion docs/notebooks/intro.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@

# %%
c = gf180.diode_dw2ps()
c
c.plot()
2 changes: 1 addition & 1 deletion docs/write_cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
[
f"{p}={repr(sig.parameters[p].default)}"
for p in sig.parameters
if isinstance(sig.parameters[p].default, (int, float, str, tuple))
if isinstance(sig.parameters[p].default, int | float | str | tuple)
and p not in skip_settings
]
)
Expand Down
2 changes: 1 addition & 1 deletion gf180/cells/klayout/pymacros/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ klayout -e
4. Create a new layout for testing.
5. Press on insert instance.
6. Go to the instance menu and select "GF180MCU" library from the library list.
7. Select the search botton and it will give the list of PCells that is available in the library.
7. Select the search button and it will give the list of PCells that is available in the library.
8. Select any cell and it will show the cell.
9. Go to the PCell tap and change the parameters as needed to change the layout of the PCells.
4 changes: 2 additions & 2 deletions gf180/cells/klayout/pymacros/cells/bjt.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def transformation_from_shape_impl(self):
def produce_impl(self):
# This is the main part of the implementation: create the layout

self.percision = 1 / self.layout.dbu
self.precision = 1 / self.layout.dbu
npn_instance = draw_bjt(layout=self.layout, device_name=self.Type)
write_cells = pya.CellInstArray(
npn_instance.cell_index(),
Expand Down Expand Up @@ -141,7 +141,7 @@ def transformation_from_shape_impl(self):
def produce_impl(self):
# This is the main part of the implementation: create the layout

self.percision = 1 / self.layout.dbu
self.precision = 1 / self.layout.dbu
pnp_instance = draw_bjt(layout=self.layout, device_name=self.Type)
write_cells = pya.CellInstArray(
pnp_instance.cell_index(),
Expand Down
38 changes: 18 additions & 20 deletions gf180/cells/klayout/pymacros/cells/draw_fet.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def get_patt_label(nl_b, nl, nt, nt_e, g_label, nl_u, nt_o):
Args :
nl_b : number of bottom connected gates transistors
nl : number of transistor
nt : patterns of tansistor [with out redundency]
nt : patterns of tansistor [with out redundancy]
nt_e : number of transistor with even order
g_label : list of transistors gate label
nl_u : number of upper connected gates transistors
Expand Down Expand Up @@ -99,13 +99,13 @@ def alter_interdig(
nl: int = 1,
patt_label: bool = False,
) -> gf.Component:
"""Returns interdigitation polygons of gate with alterating poly contacts
"""Returns interdigitation polygons of gate with alternating poly contacts
Args :
sd_diff : source/drain diffusion rectangle
pc1 : first poly contact array
pc2 : second poly contact array
poly_con : componenet of poly contact
poly_con : component of poly contact
sd_diff_inter : inter source/drain diffusion rectangle
l_gate : gate length
inter_sd_l : inter diffusion length
Expand Down Expand Up @@ -373,7 +373,7 @@ def interdigit(
sd_diff : source/drain diffusion rectangle
pc1 : first poly contact array
pc2 : second poly contact array
poly_con : componenet of poly contact
poly_con : component of poly contact
sd_diff_inter : inter source/drain diffusion rectangle
l_gate : gate length
inter_sd_l : inter diffusion length
Expand All @@ -385,9 +385,7 @@ def interdigit(

if nf == len(patt):
pat = list(patt)
nt = (
[]
) # list to store the symbols of transistors and thier number nt(number of transistors)
nt = [] # list to store the symbols of transistors and their number nt(number of transistors)
[nt.append(x) for x in pat if x not in nt]
nl = len(nt)

Expand Down Expand Up @@ -572,10 +570,10 @@ def interdigit(

# @gf.cell
def hv_gen(c, c_inst, volt, dg_encx: float = 0.1, dg_ency: float = 0.1):
"""Returns high volatge related polygons
"""Returns high voltage related polygons
Args :
c_inst : dualgate enclosed componenet
c_inst : dualgate enclosed component
volt : operating voltage
dg_encx : dualgate enclosure in x_direction
dg_ency : dualgate enclosure in y_direction
Expand Down Expand Up @@ -627,7 +625,7 @@ def bulk_gr_gen(
"""Returns guardring
Args :
c_inst : componenet enclosed by guardring
c_inst : component enclosed by guardring
comp_spacing : spacing between comp polygons
poly2_comp_spacing : spacing between comp and poly2 polygons
volt : operating voltage
Expand Down Expand Up @@ -789,7 +787,7 @@ def bulk_gr_gen(
operation="A-B",
layer=layer["metal1"],
)
) # metal1_gaurdring
) # metal1_guardring

hv_gen(c, c_inst=B, volt=volt, dg_encx=dg_enc_cmp, dg_ency=dg_enc_cmp)

Expand Down Expand Up @@ -1109,13 +1107,13 @@ def add_inter_sd_labels(
"""Adds label to intermediate source/drain diffusion
Args :
c : instance componenet of the device
c : instance component of the device
nf : number of fingers
sd_label : required source and drain labels list
poly1 : componenet of poly array
poly1 : component of poly array
l_gate : length of fet gate
inter_sd_l : length of intermediate source/drain diffusion
sd_diff_inter : componenet of intermediate source/drain polygon
sd_diff_inter : component of intermediate source/drain polygon
label: boolean of having labels
layer : layer of label
con_bet_fin : boolean of having contact between fingers
Expand Down Expand Up @@ -1143,14 +1141,14 @@ def add_gate_labels(c, g_label, pc1, c_pc, pc_spacing, nc1, nc2, pc2, label, lay
"""Adds gate label when label is enabled
Args :
c : instance componenet of the device
c : instance component of the device
g_label : required gate labels list
pc1 : componenet of poly array1
c_pc : componenet of poly array element
pc1 : component of poly array1
c_pc : component of poly array element
pc_spacing : float of space between labels
nc1 : number of columns in poly array1
nc2 : number of columns in poly array2
pc2 : componenet of poly array2
pc2 : component of poly array2
label : boolean of having labels
layer : layer of labels
nf : number of fingers
Expand Down Expand Up @@ -1287,7 +1285,7 @@ def draw_nfet(
inter_sd_l : Float of source and drain diffusion length between fingers
nf : integer of number of fingers
M : integer of number of multipliers
grw : gaurd ring width when enabled
grw : guard ring width when enabled
type : string of the device type
bulk : String of bulk connection type (None, Bulk Tie, Guard Ring)
con_bet_fin : boolean of having contacts for diffusion between fingers
Expand Down Expand Up @@ -1896,7 +1894,7 @@ def draw_pfet(
inter_sd_l : Float of source and drain diffusion length between fingers
nf : integer of number of fingers
M : integer of number of multipliers
grw : gaurd ring width when enabled
grw : guard ring width when enabled
type : string of the device type
bulk : String of bulk connection type (None, Bulk Tie, Guard Ring)
con_bet_fin : boolean of having contacts for diffusion between fingers
Expand Down
6 changes: 3 additions & 3 deletions gf180/cells/klayout/pymacros/cells/efuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ def transformation_from_shape_impl(self):
def produce_impl(self):
# This is the main part of the implementation: create the layout

self.percision = 1 / self.layout.dbu
self.precision = 1 / self.layout.dbu
efuse_instance = draw_efuse(layout=self.layout)
write_cells = pya.CellInstArray(
efuse_instance.cell_index(),
pya.Trans(pya.Point(0, 0)),
pya.Vector(self.x_spacing * self.percision, 0),
pya.Vector(0, self.y_spacing * self.percision),
pya.Vector(self.x_spacing * self.precision, 0),
pya.Vector(0, self.y_spacing * self.precision),
self.array_x,
self.array_y,
)
Expand Down
2 changes: 1 addition & 1 deletion gf180/cells/klayout/pymacros/cells/via_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def via_generator(
) -> gf.Component:
"""
return only vias withen the range xrange and yrange while enclosing by via_enclosure
and set number of rows and number of coloumns according to ranges and via size and spacing
and set number of rows and number of columns according to ranges and via size and spacing
"""

Expand Down
Loading

0 comments on commit da93148

Please sign in to comment.