Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`ProbeType.create_neuropixels_probe` warning message improvements

Aperta
#206 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

Inizia in element_array_ephys/probe.py, in ProbeType.create_neuropixels_probe(), create_neuropixels_probe() e create_neuropixels_probe_types(), usando il DuplicateError segnalato come comportamento da tracciare. Chiarisci quale comportamento proposto è desiderato, quindi assicurati che l’avviso o la gestione dei duplicati indirizzi adeguatamente gli utenti e verifica che la creazione ripetuta di sonde Neuropixels si comporti come documentato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Bug Report

Description

In our code, we had been defining our probes using the ProbeType class as such

for probe_type in ('neuropixels 1.0 - 3A', 'neuropixels 1.0 - 3B',
                   'neuropixels 2.0 - SS', 'neuropixels 2.0 - MS'):
    probe_element.ProbeType.create_neuropixels_probe(probe_type)

We recently updated to the latest version of element-array-ephys which broke our pipeline since the class version is now passed directly to probe_element.create_neuropixels_probe() which removes the skip_duplicates=True that the older version of the pipeline had, resulting in

  File "/home/[email protected]/Datajoint_projs/U19-pipeline_python/u19_pipeline/ephys_pipeline.py", line 149, in <module>
    probe_element.ProbeType.create_neuropixels_probe(probe_type)
  File "/home/[email protected]/miniconda3/envs/U19-pipeline_python_env3/lib/python3.12/site-packages/element_array_ephys/probe.py", line 77, in create_neuropixels_probe
    return create_neuropixels_probe(probe_type)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/[email protected]/miniconda3/envs/U19-pipeline_python_env3/lib/python3.12/site-packages/element_array_ephys/probe.py", line 173, in create_neuropixels_probe
    ProbeType.insert1({"probe_type": probe_type})
  File "/home/[email protected]/miniconda3/envs/U19-pipeline_python_env3/lib/python3.12/site-packages/datajoint/table.py", line 347, in insert1
    self.insert((row,), **kwargs)
  File "/home/[email protected]/miniconda3/envs/U19-pipeline_python_env3/lib/python3.12/site-packages/datajoint/table.py", line 464, in insert
    raise err.suggest(
datajoint.errors.DuplicateError: ("Duplicate entry 'neuropixels 1.0 - 3A' for key 'PRIMARY'", 'To ignore duplicate entries in insert, set skip_duplicates=True')

If follow the deprecation advice and update to:

for probe_type in ('neuropixels 1.0 - 3A', 'neuropixels 1.0 - 3B',
                   'neuropixels 2.0 - SS', 'neuropixels 2.0 - MS'):
    probe_element.create_neuropixels_probe(probe_type)

we get the same error as above since skip_dulicates=True is still not passed.

Possible solutions

There are two solutions:

  1. Keep the old behavior by passing a skip_duplicates=True to probe_element.create_neuropixels_probe similar to the older behavior.
  2. Update the Deprecation message to advise the user to replace the repeated calls of create_neuropixels_probe with a single create_neuropixels_probe_types().
Lingua principale
Jupyter Notebook
Stelle
10
Fork
44
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di datajoint/element-array-ephys

Tutte le issue di datajoint/element-array-ephys

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.