Skip to content

Commit

Permalink
added user parameter for rounding tolerance, set to 1e-4 default
Browse files Browse the repository at this point in the history
  • Loading branch information
florisvb committed Nov 29, 2017
1 parent 45697cd commit ab8469d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion figurefirst/figurefirst_user_parameters.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
save_traceback = False
cleartarget = False
spine_locations = {'top': 10, 'right': 10, 'left': 10, 'bottom': 10}
spine_locations = {'top': 10, 'right': 10, 'left': 10, 'bottom': 10}
rounding_tolerance = 1e-4
2 changes: 1 addition & 1 deletion figurefirst/svg_to_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ def __init__(self, layout_filename, autogenlayers=True,make_mplfigures = False,
# it is probably best to assert that the a.r's are the same
# for now
#assert self.layout_user_sx == self.layout_user_sy
assert (np.abs(self.layout_user_sx[0] - self.layout_user_sy[0]) < 0.00001) # rounding errors are a bitch
assert (np.abs(self.layout_user_sx[0] - self.layout_user_sy[0]) < figurefirst_user_parameters.rounding_tolerance) # rounding errors are a bitch
if make_mplfigures:
self.make_mplfigures()

Expand Down

0 comments on commit ab8469d

Please sign in to comment.