Skip to content

Graphs inconsistent w/the specification are accepted #576

@molpopgen

Description

@molpopgen

The Python API will accept this graph:

import demes

yaml = """
time_units: generations
demes:
 - name: A
   epochs:
    - start_size: 1000
 - name: B
   epochs:
    - start_size: 1000
 - name: C
   epochs:
    - start_size: 1000
pulses:
- sources: [A]
  dest: C
  proportions: [0.]
  time: 10
"""

g = demes.loads(yaml)

The JSON schema of the specification excludes 0 as a valid value for a proportion:

  proportion:
    type: number
    exclusiveMinimum: 0
    maximum: 1

Some casually grepping of the test cases in the demes-spec repo indicated that 0.0 doesn't appear anywhere over there. I could have missed it, though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions