mantle-convection-constrained / terratools

Tools to read, analyse and visualise models written by the TERRA mantle convection code
https://terratools.readthedocs.io/en/latest/
MIT License
6 stars 5 forks source link

Argument order and naming convention consistency #94

Closed anowacki closed 12 months ago

anowacki commented 12 months ago

Per the docstring for a TerraModel:

There are two kinds of methods which give you information about the contents of a TerraModel:

  1. Methods starting with get_ return a reference to something held within the model. Hence things returned by getters can be modified and the TerraModel instance is also modified. For example, get_field("vp") returns the array containing the P-wave velocity for the whole model, and you can update any values within it. You should not change the shape or length of any arrays returned from get_ methods, as this will make the internal state of a TerraModel inconsistent.

  2. Methods which are simply a noun (like number_of_compositions) return a value and this cannot be used to change the model.

However, I note we now have get_1d_mean, which doesn't conform to this (the returned values can't be used to update the model). Can we rename it mean_1d_profile?

get_1d_profile on the other hand works just as expected, but it takes coordinates in the order lat, lon, rather than lon, lat like everywhere else in the module. Can this be changed?

anowacki commented 12 months ago

Just wanted to make sure you saw this, @jamespanton93 . I'm happy to make these changes, but didn't want to make them until you were aware and approved.

anowacki commented 12 months ago

Closed by #95