Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

DataModel.get() does not get element if value is float(0) or int(0) #52

Closed
haeussma opened this issue Feb 25, 2024 · 1 comment · Fixed by #53
Closed

DataModel.get() does not get element if value is float(0) or int(0) #52

haeussma opened this issue Feb 25, 2024 · 1 comment · Fixed by #53
Assignees
Labels
bug Something isn't working

Comments

@haeussma
Copy link
Member

haeussma commented Feb 25, 2024

Tried out the following data model:

Version: 0.2.2

# Data structure of a calibration experiment
This data model describes the structure of a calibration experiment for an analyte. The calibration experiment consists of a list of samples that were measured. Each sample contains the initial concentration and the measured signal. The calibration experiment also contains information on the measurement conditions such as the temperature and pH at which the calibration experiment was performed.

## Objects

### Calibration
A `Calibration` contains information on the measurement conditions and the actual measurements of the calibration experiment for an analyte.

- analyte_name
    - type: string
    - description: Name of the analyte that was calibrated
- __inchi__
    - type: string
    - description: InChI of the analyte that was calibrated
- __date_measured__
    - type: datetime
    - description: Timestamp of when the calibration experiment was performed
- __temperature__
    - type: float
    - description: Temperature at which the calibration experiment was performed
- __ph__
    - type: float
    - description: pH at which the calibration experiment was performed
- __samples__
    - type: Sample
    - multiple: True
    - description: List of samples that were used for the calibration experiment

### Sample
A `Sample` contains describes individual measurements of a `Calibration`. 

- __init_conc__
    - type: float
    - description: Initial concentration of the sample
- __conc_unit__
    - type: string
    - description: Unit of concentration
- __measured_signal__
    - type: float
    - description: Signal that was measured for the sample
- signal_unit
    - type: string
    - description: Unit of the signal

When adding different Samples to Calibration and trying the get all init_conc values from samples/init_conc via the DataModel.get(), the returned list does not contain values of 0.0, yet these values are in the instance.

@JR-1991
Copy link
Collaborator

JR-1991 commented Feb 26, 2024

@haeussma thanks for submitting. I have created a PR that fixes it and added tests for validation. Can you try it with the PR again?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants