Dear all,

I have a requirement that makes me think that I need to "mass patch" some
ORM objects. However, I am open to any suggestions regarding the way to
answer my requirements.

I have defined an ORM object which represents a user, holding longitude and
latitude (among other attributes). At some point, I want to query many of
those users, and send them back holding the geographical distance from a
certain point (defined by longitude and latitude) along with their other
data.

Computing the distance is computationally heavy, and I noticed that I could
greatly improve performance by mass computing those distances, using numpy
for example.

My question is: would it be possible to split my flow in 2 :
- a flow that queries the data that is simply available in the database, as
ORM entities
- a flow that queries lon/lat as a numpy array, perform the distance
computation
and afterward merge those 2 in the queried ORM entities?

It is important to me that I finally get back a list of ORM entities fully
populated, because my whole downstream process is built around this
assumption.

Thanks a lot for your insights on the matter!

Regards,

Pierre

PS: giving me a "SQLAlchemy fast distance computation" won't do the trick,
because I have other kinds of computations that may not be optimizable this
way.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/CAH4TWVuJWP9WsSYNScPH%2BK9JJ3PqbOwxkm%3D_PXbPtYXzpBdvcg%40mail.gmail.com.

Reply via email to