Repository navigation
Spectro Concepts: a simulated absorption bench and an extension working on ontology terms - #31
Conversation
…e terms of the ontology manager Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN81mHyjs9x4DB6NLuNY
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
…els, with a hierarchy of terms Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN81mHyjs9x4DB6NLuNY
|
CI note: the red Generated by Claude Code |
…source Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN81mHyjs9x4DB6NLuNY
…ls allow to compute Simulated spectrometers (dark, reference, sample), two experiments with different module names, a small spectro ontology declaring the derivations (transmittance, absorbance), the extension and its tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN81mHyjs9x4DB6NLuNY
…he ontology gives the state for each measurement Remove the Ontology Logger. The extension plans the measurements from the terms of the actuators and of the spectrometer (dark: beam blocked; reference: blank cuvette; sample: sample cuvette), runs them, then computes the transmittance and the absorbance. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN81mHyjs9x4DB6NLuNY
… associated in the ontology manager The ontology no longer says that a value stands for a state: the user associates the value of each actuator, as configured on the bench, with a state term in the manager; the extension only asks for states. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN81mHyjs9x4DB6NLuNY
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN81mHyjs9x4DB6NLuNY
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN81mHyjs9x4DB6NLuNY
…neOf) of their control Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN81mHyjs9x4DB6NLuNY
… ontology manager Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN81mHyjs9x4DB6NLuNY
… of the spectrometer, states of the actuators) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN81mHyjs9x4DB6NLuNY
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN81mHyjs9x4DB6NLuNY
…re spectrometers (by plugin) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN81mHyjs9x4DB6NLuNY
…ext zone; each action and step writes to it Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN81mHyjs9x4DB6NLuNY
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN81mHyjs9x4DB6NLuNY
…s tree, a time on each line and a separator between actions Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKuN81mHyjs9x4DB6NLuNY
What this PR is
A demo of what the
OntologyManagerof PyMoDAQ (pymodaq_ontology) brings to an experiment: a simulated UV-vis absorption bench and a Dashboard extension, Spectro Concepts, that works on the terms assigned to the channels and never on the names of the modules or the values of the actuators.(An earlier version of this PR was an
OntologyLoggerextension. It was replaced by this one and its files are not in the PR any more.)What is implemented
The simulated bench (one shared simulated device, so there is nothing to link in the experiment)
daq_1Dviewer_MockSpectro: the spectrometer, counts on a wavelength axis in nm. What it gives depends on the actuators.daq_move_MockBeamBlock: the beam block (1 blocks the beam, 0 lets it through).daq_move_MockSampleChanger: the cuvette holder (0 the reference cuvette, 1 the sample).hardware/spectro_bench.py: the lamp, the dark level and the sample transmittance.spectro_lab_a.xmlandspectro_lab_b.xml, with neutral and different module names, to show that nothing depends on them.The ontology
resources/ontology/spectro_ontology.ttl, read by therdfsource of the managerowl:oneOfenumeration of their control, so the manager shows them but does not let them be assigned to a channel.pq:requiresState(the predicate the manager reads) says in which states each spectrum has its meaning, for example Dark spectrum requires Beam blocked.mock:derivedFromsays what Transmittance and Absorbance are computed from.The extension
extensions/spectro_concepts.py(Spectro Concepts in the Extensions menu), with the logic inontology_derivations.pypymodaq_ontologythe extension says it cannot work.Tests and docs
tests/test_ontology_derivations.py: the derivations, on the graph of the ontology.tests/test_spectro_concepts.py: the extension in a Dashboard with the mock bench, up to a whole measure-and-compute run, with module names that say nothing (M1, M2...).What is NOT implemented
semantic_iriannotation and the embedded ontology is done by the manager for extensions that save (see PyMoDAQ #1571, #1587), but it is not wired into this demo yet.set_measurement, PyMoDAQ #1591) nor check the actuators with it.Requirements and how to try
devwithpymodaq_ontology(the manager, the states andrequiresState, #1586) and the mock instrumentspymodaq_plugins_mock. The base branch is thedevof this repository for that reason.pymodaq_ontologyor the mock plugins are missing, so the CI of this repository does not run them.pytest tests/test_ontology_derivations.py tests/test_spectro_concepts.pywith PyMoDAQdevinstalled. The mock-instrument tests need a display (QT_QPA_PLATFORM=offscreenworks).spectro_lab_a, open the Ontology manager, loadspectro_ontology.ttl, assign Spectrum to the spectrometer, associate each actuator value with a state, then open Spectro Concepts.https://claude.ai/code/session_01RKuN81mHyjs9x4DB6NLuNY
Generated by Claude Code