Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6356610
Added dedicated circuit extraction neuron set union
chr-pok Oct 22, 2025
7275db3
Added CircuitFromID to circuit extraction
chr-pok Oct 23, 2025
f7eb713
Extended entitysdk example notebook to include circuit extraction usi…
chr-pok Oct 23, 2025
baae3c0
Reduced circuit extraction neuron set union
chr-pok Oct 23, 2025
5d21113
Removed save()
chr-pok Oct 24, 2025
2dd0610
Set proper name to staged circuit
chr-pok Oct 27, 2025
227e8df
Added campaign info
chr-pok Oct 27, 2025
f61d5a6
Added campaign info to example notebook
chr-pok Oct 27, 2025
4f3aed0
Added extracted circuit registration
chr-pok Oct 27, 2025
6932684
Added circuit folder asset upload
chr-pok Oct 28, 2025
af75919
Added registration of derivation, contributions, and publications
chr-pok Oct 28, 2025
b15016c
Linting and other small fixes
chr-pok Oct 29, 2025
b106b0b
Added info to extraction example notebook
chr-pok Oct 29, 2025
5ac6509
Changed output path
chr-pok Oct 29, 2025
980d428
Merged 'dev_circuit_extraction' into 'circuit_extraction_entitycore'
chr-pok Oct 29, 2025
9494802
Fixed constants after merge conflict
chr-pok Oct 29, 2025
cf9f232
Added Info to circuit extraction test
chr-pok Oct 29, 2025
ed7245a
Removed virtual sources to ignore
chr-pok Nov 3, 2025
39ea78a
Removed virtual sources to ignore
chr-pok Nov 3, 2025
4f6ae3e
Added proper string representation for EntityFromID
chr-pok Nov 3, 2025
3494870
Changed formatting
chr-pok Nov 3, 2025
ca48e78
Changed name to scan_config in example notebook
chr-pok Nov 3, 2025
d48026f
Improved name/description
chr-pok Nov 3, 2025
9f56ab8
Made run_validation a global setting (switched off for now)
chr-pok Nov 4, 2025
eb1cb0c
Made do_virtual and create_external non-scanable
chr-pok Nov 4, 2025
5889f3b
Made naming of Circuit and CircuitFromID objects consistent
chr-pok Nov 4, 2025
cfd29bd
Fixed test
chr-pok Nov 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building the form here works without missing parameters validation error, so I'm confused why it fails in the other notebook

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No sure, for me it did work in both notebooks.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This notebook works well! Very cool to register an extracted circuit!

A couple of small notes not related to this PR:

  1. Because the name of the person who uploaded the extractd circuit + the time of day of the upload don't show, it's difficult to see in the UI whether I successfully uploaded a circuit. I can see the count of the number of circuits incrementing though whilst its running in the UI though :)

  2. It's quite slow for such "tiny tiny circuits". Maybe we should ask about parallel registration of assets through entitysdk!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Yes, the list of circuits is currently not very useful. I hope this will be better once we have a separate view (grouping) for extraction campaigns. In any case, we should add the upload date/time/person to the list view, will take note and create a ticket for it.
  2. Yes, this could be certainly improved, especially for larger circuits. But not only registration, there are still open questions about connectivity matrix extraction, compression, etc. to be addressed separately as well.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@
"metadata": {},
"outputs": [],
"source": [
"circuit_extractions_form = obi.CircuitExtractionScanConfig(\n",
"circuit_extractions_scan_config = obi.CircuitExtractionScanConfig(\n",
" initialize=obi.CircuitExtractionScanConfig.Initialize(\n",
" circuit=[obi.Circuit(name=\"N_10__top_nodes_dim6\", path=str(input_root / \"N_10__top_nodes_dim6\" / \"circuit_config.json\")),\n",
" obi.Circuit(name=\"N_10__top_rc_nodes_dim2_rc\", path=str(input_root / \"N_10__top_rc_nodes_dim2_rc\" / \"circuit_config.json\"))],\n",
" do_virtual=False,\n",
" create_external=False,\n",
" run_validation=False,\n",
" ),\n",
" neuron_set=obi.PredefinedNeuronSet(node_set=\"Excitatory\", sample_percentage=[50, 100]),\n",
" info=obi.Info(campaign_name=\"EXC-Extraction\", campaign_description=\"Extraction of percentages of EXC neurons\"),\n",
")\n",
"\n",
"grid_scan = obi.GridScanGenerationTask(form=circuit_extractions_form, output_root=str(output_root))\n",
"grid_scan = obi.GridScanGenerationTask(form=circuit_extractions_scan_config, output_root=str(output_root))\n",
"grid_scan.execute()"
]
},
Expand Down Expand Up @@ -92,7 +92,7 @@
"outputs": [],
"source": [
"# Input circuits\n",
"for circuit in circuit_extractions_form.initialize.circuit:\n",
"for circuit in circuit_extractions_scan_config.initialize.circuit:\n",
" n_exc = len(circuit.sonata_circuit.nodes[circuit.default_population_name].ids(\"Excitatory\"))\n",
" n_inh = len(circuit.sonata_circuit.nodes[circuit.default_population_name].ids(\"Inhibitory\"))\n",
" print(f\"Circuit '{circuit}': {n_exc + n_inh} neurons ({n_exc} EXC, {n_inh} INH) and {circuit.sonata_circuit.edges[circuit.default_edge_population_name].size} synapses\")"
Expand All @@ -117,9 +117,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "obi-one (3.12.9)",
"display_name": "obi-one",
"language": "python",
"name": "python3"
"name": "obi-one"
},
"language_info": {
"codemirror_mode": {
Expand Down
4 changes: 4 additions & 0 deletions obi_one/core/entity_from_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ def entity(self, db_client: entitysdk.client.Client) -> Entity:
@property
def entitysdk_type(self) -> type[Entity]:
return self.__class__.entitysdk_class

def __str__(self) -> str:
"""Returns a string representation."""
return f"{self.__class__.__name__}_{self.id_str}"
2 changes: 1 addition & 1 deletion obi_one/scientific/from_id/circuit_from_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def stage_circuit(
)

circuit = Circuit(
name=dest_dir.name,
name=str(self),
path=str(dest_dir / "circuit_config.json"),
)
return circuit
Expand Down
3 changes: 3 additions & 0 deletions obi_one/scientific/library/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
_DEFAULT_STIMULUS_LENGTH_MILLISECONDS = 200.0
_DEFAULT_PULSE_STIMULUS_LENGTH_MILLISECONDS = 50.0
_MAX_POISSON_SPIKE_LIMIT = 5000000

_NEURON_PAIR_SIZE = 2
_MAX_SMALL_MICROCIRCUIT_SIZE = 20
Loading