gplately icon indicating copy to clipboard operation
gplately copied to clipboard

plate model must have topology features...

Open nickywright opened this issue 1 year ago • 2 comments

If using model = gplately.PlateReconstruction(rotation_model, topology_features=None, static_polygons=static_polygons) then gplot = gplately.PlotTopologies(model) results in the error

ValueError: Plate model must have topology features.

But not all plate models have topologies.

It seems like if you change the same line above to model = gplately.PlateReconstruction(rotation_model, topology_features=[], static_polygons=static_polygons) then it all works (strange, since None is the default behaviour)

Is there a way in the backend to have None = [] for the topology_features, since you can't actually use your plate model for plotting? Or does this create issues elsewhere?

nickywright avatar Feb 28 '24 04:02 nickywright

thank @nickywright bring this issue up.

If the topology_features is None or [], all the topological plotting will fail and raise exceptions, such as plot_ridges_and_transforms(), plot_trenches(), etc.

@brmather @lauren-ilano @laurilano We need to decide which behaviour is preferable?

  1. raise the error at the construction of PlotTopologies object (current behaviour)
  2. check topology_features for all topological plotting functions, print warnings and do nothing(not raise exception) if the topology_features is None or []

I am inclined to prefer option 2. But I am flexible regarding this matter.

michaelchin avatar Apr 08 '24 04:04 michaelchin

Yep, option 2 sounds best to me.

brmather avatar Apr 08 '24 04:04 brmather

This has been fixed via a few commits.

michaelchin avatar May 12 '24 05:05 michaelchin