@@ -138,6 +138,7 @@ def get_similar_neurons_cached(neuron, similarity_score='NBLAST_score', return_d
138138 """
139139 return _original_get_similar_neurons (neuron = neuron , similarity_score = similarity_score , return_dataframe = return_dataframe , limit = limit )
140140
141+ @with_solr_cache ('similar_morphology' )
141142def get_similar_morphology_cached (neuron_short_form : str , return_dataframe = True , limit : int = - 1 , force_refresh : bool = False ):
142143 """
143144 Enhanced get_similar_morphology with SOLR caching.
@@ -153,6 +154,7 @@ def get_similar_morphology_cached(neuron_short_form: str, return_dataframe=True,
153154 """
154155 return _original_get_similar_morphology (neuron_short_form = neuron_short_form , return_dataframe = return_dataframe , limit = limit )
155156
157+ @with_solr_cache ('similar_morphology_part_of' )
156158def get_similar_morphology_part_of_cached (neuron_short_form : str , return_dataframe = True , limit : int = - 1 , force_refresh : bool = False ):
157159 """
158160 Enhanced get_similar_morphology_part_of with SOLR caching.
@@ -168,6 +170,7 @@ def get_similar_morphology_part_of_cached(neuron_short_form: str, return_datafra
168170 """
169171 return _original_get_similar_morphology_part_of (neuron_short_form = neuron_short_form , return_dataframe = return_dataframe , limit = limit )
170172
173+ @with_solr_cache ('similar_morphology_part_of_exp' )
171174def get_similar_morphology_part_of_exp_cached (expression_short_form : str , return_dataframe = True , limit : int = - 1 , force_refresh : bool = False ):
172175 """
173176 Enhanced get_similar_morphology_part_of_exp with SOLR caching.
@@ -183,6 +186,7 @@ def get_similar_morphology_part_of_exp_cached(expression_short_form: str, return
183186 """
184187 return _original_get_similar_morphology_part_of_exp (expression_short_form = expression_short_form , return_dataframe = return_dataframe , limit = limit )
185188
189+ @with_solr_cache ('similar_morphology_nb' )
186190def get_similar_morphology_nb_cached (neuron_short_form : str , return_dataframe = True , limit : int = - 1 , force_refresh : bool = False ):
187191 """
188192 Enhanced get_similar_morphology_nb with SOLR caching.
@@ -197,6 +201,7 @@ def get_similar_morphology_nb_cached(neuron_short_form: str, return_dataframe=Tr
197201 """
198202 return _original_get_similar_morphology_nb (neuron_short_form = neuron_short_form , return_dataframe = return_dataframe , limit = limit )
199203
204+ @with_solr_cache ('similar_morphology_nb_exp' )
200205def get_similar_morphology_nb_exp_cached (expression_short_form : str , return_dataframe = True , limit : int = - 1 , force_refresh : bool = False ):
201206 """
202207 Enhanced get_similar_morphology_nb_exp with SOLR caching.
@@ -211,6 +216,9 @@ def get_similar_morphology_nb_exp_cached(expression_short_form: str, return_data
211216 """
212217 return _original_get_similar_morphology_nb_exp (expression_short_form = expression_short_form , return_dataframe = return_dataframe , limit = limit )
213218
219+ # Deliberately not @with_solr_cache: the key is a per-session user upload id,
220+ # so the result is user/session-specific and not safe to share via the
221+ # persistent cache. Left to recompute (and to the in-memory L1 cache only).
214222def get_similar_morphology_userdata_cached (upload_id : str , return_dataframe = True , limit : int = - 1 , force_refresh : bool = False ):
215223 """
216224 Enhanced get_similar_morphology_userdata with SOLR caching.
@@ -295,6 +303,7 @@ def get_templates_cached(limit: int = -1, return_dataframe: bool = False, force_
295303 """
296304 return _original_get_templates (limit = limit , return_dataframe = return_dataframe , force_refresh = force_refresh )
297305
306+ @with_solr_cache ('related_anatomy' )
298307def get_related_anatomy_cached (template_short_form : str , limit : int = - 1 , return_dataframe : bool = False , force_refresh : bool = False ):
299308 """
300309 Enhanced get_related_anatomy with SOLR caching.
@@ -348,6 +357,7 @@ def get_template_roi_tree_cached(template_short_form: str, return_dataframe: boo
348357 """
349358 return _original_get_template_roi_tree (template_short_form = template_short_form , return_dataframe = return_dataframe )
350359
360+ @with_solr_cache ('dataset_images' )
351361def get_dataset_images_cached (dataset_short_form : str , return_dataframe = True , limit : int = - 1 , force_refresh : bool = False ):
352362 """
353363 Enhanced get_dataset_images with SOLR caching.
@@ -362,6 +372,7 @@ def get_dataset_images_cached(dataset_short_form: str, return_dataframe=True, li
362372 """
363373 return _original_get_dataset_images (dataset_short_form = dataset_short_form , return_dataframe = return_dataframe , limit = limit )
364374
375+ @with_solr_cache ('all_aligned_images' )
365376def get_all_aligned_images_cached (template_short_form : str , return_dataframe = True , limit : int = - 1 , force_refresh : bool = False ):
366377 """
367378 Enhanced get_all_aligned_images with SOLR caching.
@@ -391,6 +402,7 @@ def get_aligned_datasets_cached(template_short_form: str, return_dataframe=True,
391402 """
392403 return _original_get_aligned_datasets (template_short_form = template_short_form , return_dataframe = return_dataframe , limit = limit )
393404
405+ @with_solr_cache ('all_datasets' )
394406def get_all_datasets_cached (return_dataframe = True , limit : int = - 1 , force_refresh : bool = False ):
395407 """
396408 Enhanced get_all_datasets with SOLR caching.
@@ -404,10 +416,16 @@ def get_all_datasets_cached(return_dataframe=True, limit: int = -1, force_refres
404416 """
405417 return _original_get_all_datasets (return_dataframe = return_dataframe , limit = limit )
406418
419+ @with_solr_cache ('individual_neuron_inputs' )
407420def get_individual_neuron_inputs_cached (neuron_short_form : str , return_dataframe = True , limit : int = - 1 , summary_mode : bool = False , force_refresh : bool = False ):
408421 """
409422 Enhanced get_individual_neuron_inputs with SOLR caching.
410423
424+ Note: the SOLR cache keys on the neuron id (and return_dataframe). The
425+ REST path always calls with summary_mode=False, so the default key is
426+ safe there; a non-default summary_mode is not part of the cache key, so
427+ direct library callers that vary it should pass force_refresh.
428+
411429 Args:
412430 neuron_short_form: Neuron short form
413431 return_dataframe: Whether to return DataFrame or list of dicts
@@ -484,6 +502,7 @@ def get_anatomy_scrnaseq_cached(anatomy_short_form: str, return_dataframe=True,
484502 """
485503 return _original_get_anatomy_scrnaseq (anatomy_short_form = anatomy_short_form , return_dataframe = return_dataframe , limit = limit )
486504
505+ @with_solr_cache ('cluster_expression' )
487506def get_cluster_expression_cached (cluster_short_form : str , return_dataframe = True , limit : int = - 1 , force_refresh : bool = False ):
488507 """
489508 Enhanced get_cluster_expression with SOLR caching.
@@ -498,6 +517,7 @@ def get_cluster_expression_cached(cluster_short_form: str, return_dataframe=True
498517 """
499518 return _original_get_cluster_expression (cluster_short_form = cluster_short_form , return_dataframe = return_dataframe , limit = limit )
500519
520+ @with_solr_cache ('expression_cluster' )
501521def get_expression_cluster_cached (gene_short_form : str , return_dataframe = True , limit : int = - 1 , force_refresh : bool = False ):
502522 """
503523 Enhanced get_expression_cluster with SOLR caching.
@@ -512,6 +532,7 @@ def get_expression_cluster_cached(gene_short_form: str, return_dataframe=True, l
512532 """
513533 return _original_get_expression_cluster (gene_short_form = gene_short_form , return_dataframe = return_dataframe , limit = limit )
514534
535+ @with_solr_cache ('scrnaseq_dataset_data' )
515536def get_scrnaseq_dataset_data_cached (dataset_short_form : str , return_dataframe = True , limit : int = - 1 , force_refresh : bool = False ):
516537 """
517538 Enhanced get_scrnaseq_dataset_data with SOLR caching.
@@ -526,6 +547,7 @@ def get_scrnaseq_dataset_data_cached(dataset_short_form: str, return_dataframe=T
526547 """
527548 return _original_get_scrnaseq_dataset_data (dataset_short_form = dataset_short_form , return_dataframe = return_dataframe , limit = limit )
528549
550+ @with_solr_cache ('transgene_expression_here' )
529551def get_transgene_expression_here_cached (anatomy_short_form : str , return_dataframe = True , limit : int = - 1 , force_refresh : bool = False ):
530552 """
531553 Enhanced get_transgene_expression_here with SOLR caching.
0 commit comments