Conversation
|
@chervias I'd like to know if the function |
| if len(tods) == 0: # pragma: no cover | ||
| raise ValueError(f"No TODs with obs ID {obs_id} found.") | ||
|
|
||
| depth_one_maps = [tod.maps for tod in tods][0] |
There was a problem hiding this comment.
This only returns a single map right? When in reality multiple may match.
I think you can do this all in one sql query:
SELECT m.*
FROM depth_one_maps AS m
JOIN link_tod_to_depth_one_map AS link
ON m.map_id = link.map_id
JOIN tod_depth_one AS t
ON link.tod_id = t.tod_id
WHERE t.obs_id = 'obs_1758179265_lati1_111'
There should be some way of representing this as SQLAlchemy...
There was a problem hiding this comment.
This should be able to return multiple maps, see 209/210 in test_mapmaking.py. I did just notice that the [0] index is cutting it down to only the first returned TOD. I forgot about this issue, I was treating the obs_idas if there could be more than one TOD with a givenobs_id, but that shouldn't be. The obs_id` are one-to-one with the TODs. I'll change that.
|
Hi @Sulla2012 yes I think it works. So in theory we will have a list of maps-to-be-made in the mapmaker, and then we need to run that list against something checking which maps stay and which maps are removed. Is it any different running that list against the full sql database versus running that list against the output of |
Add a
build_obslistanalogue to map cat. This function allows users to input a list ofobs_idsand receive 1) a dict with keys theobs_idand entries the Depth-1 maps associated with eachobs_idand 2) a list ofobs_idnot in any map.