Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updates for streamlining and efficiency.
I've altered some things to reduce the verbosity of the code required to use Daft.
add_node()
andadd_plate()
to automatically define the class so that the use of the two is matched toadd_edge()
. Maintains compatibility with existing code by checking if first parameter is the class instead of the first parameter passed to the class.Plate()
classkwargs
->plot_params
.kwarg
to set linewidth forPlate()
class rectangle object.bbox
to'None'
as opposed to matplotlib default of cyan (meaning it nearly always had to be specified because cyan is likely a terrible choice).add_plate()
andPlate()
class to setfontsize
.add_node()
andNode()
class to setfontsize
. This already existed inlabel_params
but was done for consistency withadd_plate()
andPlate()
.pgm.render()
in new functionpgm.show()
to add aplt.show()
call.pgm.figure.savefig()
still works afterpgm.show()
.Both sets of code below still function properly, but the proposed changes simplify things somewhat.
Example #1 before changes:
Example #1 after changes: