Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ducky64 committed Aug 24, 2024
1 parent 458b61e commit 8b7cd27
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 29 deletions.
4 changes: 1 addition & 3 deletions edg/parts/JlcBjt.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,4 @@ def parse_row(row: PartsTableRow) -> Optional[Dict[PartsTableColumn, Any]]:
new_cols.update(cls._parse_jlcpcb_common(row))
return new_cols

return cls._jlc_table().map_new_columns(parse_row).sort_by(
lambda row: [row[cls.BASIC_PART_HEADER], FootprintAreaTable.area_of(row[cls.KICAD_FOOTPRINT]), row[cls.COST]]
)
return cls._jlc_table().map_new_columns(parse_row)
3 changes: 1 addition & 2 deletions edg/parts/JlcCapacitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ def filter_minimum_size(row: PartsTableRow) -> Optional[Dict[PartsTableColumn, A

@classmethod
def _row_sort_by(cls, row: PartsTableRow) -> Any:
return [row[cls.PARALLEL_COUNT], row[cls.BASIC_PART_HEADER],
FootprintAreaTable.area_of(row[cls.KICAD_FOOTPRINT]), row[cls.COST]]
return [row[cls.PARALLEL_COUNT], super(JlcCapacitor, cls)._row_sort_by(row)]

def _make_parallel_footprints(self, row: PartsTableRow) -> None:
cap_model = JlcDummyCapacitor(set_lcsc_part=row[self.LCSC_PART_HEADER],
Expand Down
4 changes: 1 addition & 3 deletions edg/parts/JlcCrystal.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,4 @@ def parse_row(row: PartsTableRow) -> Optional[Dict[PartsTableColumn, Any]]:
new_cols.update(cls._parse_jlcpcb_common(row))
return new_cols

return cls._jlc_table().map_new_columns(parse_row).sort_by(
lambda row: [row[cls.BASIC_PART_HEADER], FootprintAreaTable.area_of(row[cls.KICAD_FOOTPRINT]), row[cls.COST]]
)
return cls._jlc_table().map_new_columns(parse_row)
8 changes: 2 additions & 6 deletions edg/parts/JlcDiode.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ def parse_row(row: PartsTableRow) -> Optional[Dict[PartsTableColumn, Any]]:
new_cols.update(cls._parse_jlcpcb_common(row))
return new_cols

return cls._jlc_table().map_new_columns(parse_row).sort_by(
lambda row: [row[cls.BASIC_PART_HEADER], FootprintAreaTable.area_of(row[cls.KICAD_FOOTPRINT]), row[cls.COST]]
)
return cls._jlc_table().map_new_columns(parse_row)


class JlcZenerDiode(TableZenerDiode, JlcTableSelector, JlcBaseDiode):
Expand Down Expand Up @@ -110,6 +108,4 @@ def parse_row(row: PartsTableRow) -> Optional[Dict[PartsTableColumn, Any]]:
new_cols.update(cls._parse_jlcpcb_common(row))
return new_cols

return cls._jlc_table().map_new_columns(parse_row).sort_by(
lambda row: [row[cls.BASIC_PART_HEADER], row[cls.KICAD_FOOTPRINT], row[cls.COST]]
)
return cls._jlc_table().map_new_columns(parse_row)
4 changes: 0 additions & 4 deletions edg/parts/JlcElectrolyticCapacitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,3 @@ def parse_row(row: PartsTableRow) -> Optional[Dict[PartsTableColumn, Any]]:
return new_cols

return cls._jlc_table().map_new_columns(parse_row)

@classmethod
def _row_sort_by(cls, row: PartsTableRow) -> Any:
return [row[cls.BASIC_PART_HEADER], FootprintAreaTable.area_of(row[cls.KICAD_FOOTPRINT]), row[cls.COST]]
4 changes: 0 additions & 4 deletions edg/parts/JlcFerriteBead.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,3 @@ def parse_row(row: PartsTableRow) -> Optional[Dict[PartsTableColumn, Any]]:
return new_cols

return cls._jlc_table().map_new_columns(parse_row)

@classmethod
def _row_sort_by(cls, row: PartsTableRow) -> Any:
return [row[cls.BASIC_PART_HEADER], FootprintAreaTable.area_of(row[cls.KICAD_FOOTPRINT]), row[cls.COST]]
4 changes: 1 addition & 3 deletions edg/parts/JlcFet.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ def parse_row(row: PartsTableRow) -> Optional[Dict[PartsTableColumn, Any]]:
new_cols.update(cls._parse_jlcpcb_common(row))
return new_cols

return cls._jlc_table().map_new_columns(parse_row).sort_by(
lambda row: [row[cls.BASIC_PART_HEADER], FootprintAreaTable.area_of(row[cls.KICAD_FOOTPRINT]), row[cls.COST]]
)
return cls._jlc_table().map_new_columns(parse_row)


class JlcFet(JlcBaseFet, TableFet):
Expand Down
2 changes: 1 addition & 1 deletion edg/parts/JlcOscillator.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def parse_row(row: PartsTableRow) -> Optional[Dict[PartsTableColumn, Any]]:
new_cols.update(cls._parse_jlcpcb_common(row))
return new_cols

return cls._jlc_table().map_new_columns(parse_row).sort_by(
return cls._jlc_table().map_new_columns(parse_row).sort_by( # TODO dedup w/ JlcTableSelector._row_sort_by
lambda row: [row[cls.BASIC_PART_HEADER], FootprintAreaTable.area_of(row[cls.KICAD_FOOTPRINT]), row[cls.COST]]
)

Expand Down
4 changes: 1 addition & 3 deletions edg/parts/JlcResistorArray.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,4 @@ def parse_row(row: PartsTableRow) -> Optional[Dict[PartsTableColumn, Any]]:
new_cols.update(cls._parse_jlcpcb_common(row))
return new_cols

return cls._jlc_table().map_new_columns(parse_row).sort_by(
lambda row: [row[cls.BASIC_PART_HEADER], FootprintAreaTable.area_of(row[cls.KICAD_FOOTPRINT]), row[cls.COST]]
)
return cls._jlc_table().map_new_columns(parse_row)

0 comments on commit 8b7cd27

Please sign in to comment.