vfbquery 0.4.1__py3-none-any.whl → 0.5.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. test/readme_parser.py +29 -27
  2. test/term_info_queries_test.py +46 -34
  3. test/test_dataset_template_queries.py +138 -0
  4. test/test_default_caching.py +89 -84
  5. test/test_examples_code.py +7 -0
  6. test/test_examples_diff.py +95 -172
  7. test/test_expression_overlaps.py +183 -0
  8. test/test_expression_pattern_fragments.py +123 -0
  9. test/test_images_neurons.py +152 -0
  10. test/test_images_that_develop_from.py +112 -0
  11. test/test_lineage_clones_in.py +190 -0
  12. test/test_nblast_queries.py +124 -0
  13. test/test_neuron_classes_fasciculating.py +187 -0
  14. test/test_neuron_inputs.py +193 -0
  15. test/test_neuron_neuron_connectivity.py +89 -0
  16. test/test_neuron_region_connectivity.py +117 -0
  17. test/test_neurons_part_here.py +203 -0
  18. test/test_new_owlery_queries.py +282 -0
  19. test/test_publication_transgene_queries.py +101 -0
  20. test/test_query_performance.py +739 -0
  21. test/test_similar_morphology.py +177 -0
  22. test/test_tracts_nerves_innervating.py +188 -0
  23. test/test_transcriptomics.py +223 -0
  24. vfbquery/__init__.py +47 -35
  25. vfbquery/cached_functions.py +772 -131
  26. vfbquery/neo4j_client.py +120 -0
  27. vfbquery/owlery_client.py +463 -0
  28. vfbquery/solr_cache_integration.py +34 -30
  29. vfbquery/solr_fetcher.py +1 -1
  30. vfbquery/solr_result_cache.py +338 -36
  31. vfbquery/term_info_queries.py +1 -1
  32. vfbquery/vfb_queries.py +2969 -627
  33. vfbquery-0.5.1.dist-info/METADATA +2806 -0
  34. vfbquery-0.5.1.dist-info/RECORD +40 -0
  35. vfbquery-0.4.1.dist-info/METADATA +0 -1315
  36. vfbquery-0.4.1.dist-info/RECORD +0 -19
  37. {vfbquery-0.4.1.dist-info → vfbquery-0.5.1.dist-info}/LICENSE +0 -0
  38. {vfbquery-0.4.1.dist-info → vfbquery-0.5.1.dist-info}/WHEEL +0 -0
  39. {vfbquery-0.4.1.dist-info → vfbquery-0.5.1.dist-info}/top_level.txt +0 -0
vfbquery/__init__.py CHANGED
@@ -1,55 +1,67 @@
1
1
  from .vfb_queries import *
2
2
  from .solr_result_cache import get_solr_cache
3
3
 
4
- # Caching enhancements (optional import - don't break if dependencies missing)
4
+ # SOLR-based caching (simplified single-layer approach)
5
5
  try:
6
- from .cache_enhancements import (
7
- enable_vfbquery_caching,
8
- disable_vfbquery_caching,
9
- clear_vfbquery_cache,
10
- get_vfbquery_cache_stats,
11
- set_cache_ttl,
12
- set_cache_memory_limit,
13
- set_cache_max_items,
14
- enable_disk_cache,
15
- disable_disk_cache,
16
- get_cache_config,
17
- CacheConfig
18
- )
19
6
  from .cached_functions import (
20
7
  get_term_info_cached,
21
- get_instances_cached,
22
- patch_vfbquery_with_caching,
23
- unpatch_vfbquery_caching
8
+ get_instances_cached,
9
+ get_templates_cached,
10
+ get_related_anatomy_cached,
11
+ get_similar_neurons_cached,
12
+ get_individual_neuron_inputs_cached,
13
+ get_expression_overlaps_here_cached,
14
+ get_neurons_with_part_in_cached,
15
+ get_neurons_with_synapses_in_cached,
16
+ get_neurons_with_presynaptic_terminals_in_cached,
17
+ get_neurons_with_postsynaptic_terminals_in_cached,
18
+ get_components_of_cached,
19
+ get_parts_of_cached,
20
+ get_subclasses_of_cached,
21
+ get_neuron_classes_fasciculating_here_cached,
22
+ get_tracts_nerves_innervating_here_cached,
23
+ get_lineage_clones_in_cached,
24
+ get_neuron_neuron_connectivity_cached,
25
+ get_neuron_region_connectivity_cached,
26
+ get_images_neurons_cached,
27
+ get_images_that_develop_from_cached,
28
+ get_expression_pattern_fragments_cached,
29
+ get_anatomy_scrnaseq_cached,
30
+ get_cluster_expression_cached,
31
+ get_expression_cluster_cached,
32
+ get_scrnaseq_dataset_data_cached,
33
+ get_similar_morphology_cached,
34
+ get_similar_morphology_part_of_cached,
35
+ get_similar_morphology_part_of_exp_cached,
36
+ get_similar_morphology_nb_cached,
37
+ get_similar_morphology_nb_exp_cached,
38
+ get_similar_morphology_userdata_cached,
39
+ get_painted_domains_cached,
40
+ get_dataset_images_cached,
41
+ get_all_aligned_images_cached,
42
+ get_aligned_datasets_cached,
43
+ get_all_datasets_cached,
44
+ get_terms_for_pub_cached,
45
+ get_transgene_expression_here_cached,
24
46
  )
25
47
  __caching_available__ = True
26
-
27
- # Enable caching by default with 3-month TTL and 2GB memory cache
48
+
49
+ # Enable SOLR caching by default with 3-month TTL
28
50
  import os
29
51
 
30
52
  # Check if caching should be disabled via environment variable
31
53
  cache_disabled = os.getenv('VFBQUERY_CACHE_ENABLED', 'true').lower() in ('false', '0', 'no', 'off')
32
54
 
33
55
  if not cache_disabled:
34
- # Enable caching with VFB_connect-like defaults
35
- enable_vfbquery_caching(
36
- cache_ttl_hours=2160, # 3 months (90 days)
37
- memory_cache_size_mb=2048, # 2GB memory cache
38
- max_items=10000, # Max 10k items as safeguard
39
- disk_cache_enabled=True # Persistent across sessions
40
- )
41
-
42
- # Automatically patch existing functions for transparent caching
56
+ # Import and patch functions with caching
57
+ from .cached_functions import patch_vfbquery_with_caching
43
58
  patch_vfbquery_with_caching()
44
-
45
- print("VFBquery: Caching enabled by default (3-month TTL, 2GB memory)")
59
+ print("VFBquery: SOLR caching enabled by default (3-month TTL)")
46
60
  print(" Disable with: export VFBQUERY_CACHE_ENABLED=false")
47
-
61
+
48
62
  except ImportError:
49
63
  __caching_available__ = False
50
- print("VFBquery: Caching not available (dependencies missing)")
51
-
52
- # Convenience function for clearing SOLR cache entries
64
+ print("VFBquery: Caching not available (dependencies missing)")# Convenience function for clearing SOLR cache entries
53
65
  def clear_solr_cache(query_type: str, term_id: str) -> bool:
54
66
  """
55
67
  Clear a specific SOLR cache entry to force refresh
@@ -83,4 +95,4 @@ except ImportError:
83
95
  __solr_caching_available__ = False
84
96
 
85
97
  # Version information
86
- __version__ = "0.4.1"
98
+ __version__ = "0.5.1"