Skip to content

Commit

Permalink
Begin refactoring pybom to use a better interface
Browse files Browse the repository at this point in the history
- Added generic BOMMatcher with Octopart implementation
- Moved caching to a higher layer
- Made the interface compatible with typedargs

Update typedargs with class containing type_system code

- Also expand unit test coverage of type system
- Add default string formatting for exceptions

Update for more consistent use of new type_system

Add initial support for complex types

- Add a map type that can take any two other types as key and value types

Add typed return values to type system

Update bom_matcher to use typed return value

Update typedargs to export return_type

Update typesystem to allow complex types in param and return_type

Fix return value printing

Begin creating provider-agnostic part information

Add list complex type to typedargs

Finish refactoring octopart code
- Start refactoring board extraction and pricing code

Refactored pybom
- Added momo friendly CircuitBoard object
- Simplified generation of pricing models
- Consolidated code for getting bom information

rename bom_lines() to capture what it does

Fix improper location of config file

Start finishign up pcbtool

Fix help display in momo tool.

Remove dirspec dependency and replace with in-house alternative

Update README to remove mention of dirspec

Update typedargs with class containing type_system code

- Also expand unit test coverage of type system
- Add default string formatting for exceptions

Fix improper location of config file

Update for more consistent use of new type_system

Add initial support for complex types

- Add a map type that can take any two other types as key and value types

Update typedargs to export return_type

Update typesystem to allow complex types in param and return_type

Fix help display in momo tool.

Add bool type

Don't require a variant when there is only one option

Add test for circuitboard

- start work on partcache, moving from ZODB to integrated sqlite

Recreate cache functionality on top of sqlite

Still need to integrate into bommatching

Start making CircuitBoard agnostic of the generating program.

Begin the great refactor to make CircuitBoard agnostic of the
type of board file that it was generated from.  This does not
work yet but is on its way.

Rename pybom to pcb

Working version of refactored CircuitBoard

Attribute updating works now on eagle board files

Integrate part cache into bom matching object

Working version of part caching

Working partcache integrated into bom_matcher

Working part caching and unit tests for part matching

Rename unit tests from pybom to pcb to match new package name

Update TODO status

Add support for updating metadata in boards and writing BOM lines

Fix unit tests and partcache to use global defaults

Fix unit tests for pcb tools

Fix refactor copy/paste error and remove unnecessary setup dependencies

Working excel exporting of BOMs

Pump version 1.1.0 since we added a new bom feature

Add unit test to exercise excel exporting

Fix bug handling empty manufacturers

Fix processing of assembly variants in eagle and add tests for it

Update CircuitBoard to support pricing BOMs

- Also fix issue with unicode display inside physical parts objects
not being converted correctly to ascii when using __str__
- Updated type system to include price objects.

Update momo to only display traceback information during an APIError

Starting work on integrating fab and assy drawing generation

Additional work on fab generation

Update momo tool to lazily load modules when possible

This cuts the startup time in half and will be very important going
forward to make sure we keep the tool responsible and speedy

Working version of production file generation

Add unit test for building production files

- note: EAGLE needs brd files to be named .brd for CAM processing to work

Remove non conforming exception and update TODO docs

Update production generation to zip up result

Fix libedit logic to only apply on mac os x and not on Windows too

Start autofinding EAGLE on various OS

Add eagle autofind on mac os x in standard location

Update version number

Update modtool to show progress bars
  • Loading branch information
timburke committed Mar 12, 2015
1 parent 59297a6 commit 8679ab6
Show file tree
Hide file tree
Showing 79 changed files with 17,933 additions and 1,214 deletions.
2 changes: 1 addition & 1 deletion pymomo/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.10"
__version__ = "1.1.1"
1 change: 0 additions & 1 deletion pymomo/commander/commands/rpc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from command import Command
from pymomo.commander.exceptions import *
import base64
Expand Down
75 changes: 75 additions & 0 deletions pymomo/config/pcb/eagle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"templates":
{
"two_layer":
{
"layers":
{
"Top Solderpaste Layer":
{
"extension": "crm",
"program_layers": ["tCream"],
"type": "gerber",
"remove": "gpi"
},

"Top Silkscreen Layer":
{
"extension": "plc",
"program_layers": ["Dimension", "tPlace", "tNames"],
"type": "gerber",
"remove": "gpi"
},

"Top Copper Layer":
{
"extension": "cmp",
"program_layers": ["Top", "Pads", "Vias"],
"type": "gerber",
"remove": "gpi"
},

"Bottom Copper Layer":
{
"extension": "sol",
"program_layers": ["Bottom", "Pads", "Vias"],
"type": "gerber",
"remove": "gpi"
},

"Top Soldermask Layer":
{
"extension": "stc",
"program_layers": ["tStop"],
"type": "gerber",
"remove": "gpi"
},

"Bottom Soldermask Layer":
{
"extension": "sts",
"program_layers": ["bStop"],
"type": "gerber",
"remove": "gpi"
},

"Drill Information":
{
"extension": "drd",
"program_layers": ["Drills", "Holes"],
"type": "excellon",
"remove": "dri"
}
},

"assembly":
{
"program_layers": ["tPlace", "tNames", "tDocu", "Document", "Reference","Dimension"],
"type": "drawing",
"extension": "ps"
},

"description": "Two layer board, Top silkscreen only, Soldermask on both sides"
}
}
}
File renamed without changes.
35 changes: 34 additions & 1 deletion pymomo/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ def format_msg(self):

return msg

def __str__(self):
msg = self.format()
return msg

class ValidationError(MoMoException):
"""
API routines can impose validation criteria on their arguments in
Expand Down Expand Up @@ -78,11 +82,22 @@ class ArgumentError(MoMoException):

pass

class DataError(MoMoException):
"""
The method relied on data pass in by the user and the data was invalid.
This could be because a file was the wrong type or because a data provider
returned an unexpected result. The parameters passed with this exception
provide more detail on what occurred and where.
"""

pass

class InternalError(MoMoException):
"""
The method could not be completed with the user input passed for
an unexpected reason. This does not signify a bug in the API
method code. More details should be passed in the arguments
method code. More details should be passed in the arguments.
"""

pass
Expand All @@ -109,4 +124,22 @@ class BuildError(MoMoException):
that something is misconfigured.
"""

pass

class TypeSystemError(MoMoException):
"""
There was an error with the MoMo type system. This can be due to improperly
specifying an unknown type or because the required type was not properly loaded
from an external module before a function that used that type was needed.
"""

pass

class EnvironmentError(MoMoException):
"""
The environment is not properly configured for the MoMo API command that was called.
This can be because a required program was not installed or accessible or because
a required environment variable was not defined.
"""

pass
22 changes: 22 additions & 0 deletions pymomo/pcb/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""
A package for managing bills of materials and pcb fabrication
Methods and objects for creating and pricing bills of materials
as well as automatically generating gerber files for pcb fabrication.
- The CircuitBoard object provides a way to generate BOMs and production
files for pcb fabrication from ECAD files
- various BOM pricing and matching engines like OctopartMatcher allow you
to see how much your BOM would cost in different quantities.
"""

_name_ = "pcb"


#Add in required types that we need
import types
import pymomo.utilities.typedargs
pymomo.utilities.typedargs.type_system.load_type_module(types)

from match_engines import *
from board import CircuitBoard
Loading

0 comments on commit 8679ab6

Please sign in to comment.