:py:mod:`gnome.environment.grid` ================================ .. py:module:: gnome.environment.grid .. autoapi-nested-parse:: grid for wind or current data Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: gnome.environment.grid.Grid .. py:class:: Grid(filename, topology_file=None, grid_type=1, extrapolate=False, time_offset=0, **kwargs) Bases: :py:obj:`gnome.environment.environment.Environment` Defines a grid for a current or wind Initializes a grid object from a file and a grid type. Maybe allow a grid to be passed in eventually, otherwise filename required All other keywords are optional. Optional parameters (kwargs): :param grid_type: default is 1 - regular grid (eventually figure this out from file) .. py:property:: grid_type .. py:attribute:: _schema .. py:attribute:: extrapolate .. py:attribute:: time_offset .. py:method:: __repr__() Return repr(self). .. py:method:: __str__() Return str(self). .. py:method:: prepare_for_model_run(model_time) Not sure we need to do anything here .. py:method:: prepare_for_model_step(model_time) Make sure we have the right data loaded .. py:method:: get_value(time, location) Return the value at specified time and location. .. py:method:: get_values(model_time, positions, velocities) Return the values for the given positions .. py:method:: serialize(json_='webapi') Returns a json serialization of this object ("webapi" mode only) .. py:method:: deserialize(json_) :classmethod: classmethod takes json structure as input, deserializes it using a colander schema then invokes the new_from_dict method to create an instance of the object described by the json schema. We also need to accept sparse json objects, in which case we will not treat them, but just send them back.