arpastrana / compas_cem

Inverse design of 3D trusses with automatic differentiation
https://arpastrana.github.io/compas_cem
MIT License
36 stars 7 forks source link

potential dependency conflicts #8

Closed ga58xes closed 2 years ago

ga58xes commented 2 years ago

Hi, just updated compas and installed compas_cem and noticed that compas last in v1.1.0 has the class NetworkPlotter (compas_plotters\networkplotter.py) which is also called by TopologyPlotter (compas_cem\plotters\topology_plotter.py). So I did a compas downgrade to v1.1.0 again; pip now tells me that compas_cem v0.2.1 needs at least compas v1.7, but first tests work fine with compas v1.1.0. Just wanted to let you know, because it might cause some problems after all.

arpastrana commented 2 years ago

Hey, thanks for letting me know! I was unaware NetworkPlotter was deprecated. Will look into it.

Did you see an error thrown when working with COMPAS==1.7 or was it only a warning printed? Would you mind sharing a minimal example replicating the error/warning you see?

ga58xes commented 2 years ago

compas_cem under compas v1.7 should throw a ModuleNotFoundError regarding NetworkPlotter when executing compas_cem/examples/02_braced_tower_2d.py

arpastrana commented 2 years ago

The issue seems to be solved by pinning the COMPAS dependency to COMPAS==1.8.1. Later versions of COMPAS deprecated NetworkPlotter(). Need to catch up on this.

If you update COMPAS CEM to 0.2.2 via pip install --upgrade compas-cem, the examples should run.

Does it work for you?

ga58xes commented 2 years ago

Yes, the example runs with compas v1.8.1, NetworkPlotter is available. What is the higher logic behind doing without the NetworkPlotter again in the compas releases newer than v1.8.1? :-D

arpastrana commented 2 years ago

Great!

My best guess is that the COMPAS dev team wanted to make the Plotter system similar in functionality and spirit to what the code structure they use in other visualization instruments like in the 3d viewer of compas_view2.

That system consists of having Artists taking the responsibility of drawing specific objects, say specific geometric datatypes (circles, pipes, points) and datastructures (networks, meshes, etc). For our purposes of drawing COMPAS CEM networks, I believe a NetworkArtist() would come to the closest replacement to how we use NetworkPlotter().

As a result, a Plotter() becomes more of a scene-manager to which a user can ask to "add" different artists into the same plotted scene (say, a NetworkArtist() and many PointArtist()).

Does this make sense to you?

arpastrana commented 2 years ago

Closed via d42fd4d8a2100ccb8bdf5a5d580c8277161b5f46.

arpastrana commented 2 years ago

Hi @ga58xes! FYI, compas_cem has been updated to catch up with the latest version of compas. Check out the new plotter visualization approach in the examples section!