Two proposed changes to SMTK methods
g-weatherill opened this issue · 1 comments
g-weatherill commented
Two changes are proposed that would modify the calls to specific functions:
-
Change the
smtk.response_spectrum.Response Spectrum
class to execute the response spectrum analysis immediate on instantiation -
Change the
smtk.trellis.trellis_plots.BaseTrellis
class so that.create_plot()
is not run on instantiation. Instead a simple.plot()
function should be added which is called subsequently. This can permit generation of trellis ground motion values without invoking the plotting functionality
rizac commented
Hey,
- I see the point of doing that. What about about making the class callable like a function (via
__call__
instead ofevaluate()
?) it basically maintains the current functionality (which might be handy, to postpone calculatation if needed) and adds yours by simply typing "()". Something like:
obj = NewmarkBeta(...) # as it is now. Evaluate later
result = NewmarkBeta(...)() # evaluate it now
- As we already discussed, are there plans to separate plotting stuff from base code, so that if we include the code as backend we might never need to import
matplotlib
? This might be of great help