Temporary hack to load GFAs containing more than 256 paths #1
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.
@Tharos-ux : bug observed by Daria.
Using
get_palette()
frommathplotlib_tools.py
generates a crash when trying to load a GFA with more than 256 paths.Indeed, this function returns a palette bounded by :
Problem: N=256 by default in the colormap constructor, which is instantiated before this line via an eval function. As a results, the min is always 256 and GFAs with more than 256 paths will crash the gfagraphs GFA parser.
Temporary fix in this PR: a manual instanciationof a Colormap is followed by the build of the palette, reproducing a few lines from
get_palette()
.Long term fix? : the GFA parser mixes concepts of parsing and visualisation. The latter should probably be separated and plotting operations should be split from file related operations. (mathplotlib should not be involved when only trying to load GFAs).