Skip to content

Humdrum editorials/ part splits cause Nans in duration features #369

@gg-g

Description

@gg-g

Python: 3.12.4
Partitura: 1.5.0 (develop branch)

When loading BWV 875b:

import numpy as np
import pandas as pd
import partitura as pt


score = pt.load_kern('testdata/875b.krn')

note_array = score.note_array(
    include_pitch_spelling=True,
    include_metrical_position=True
)
df = pd.DataFrame(note_array)
df[df.isna().any(axis=1)]

duration_beat and duration_quarter are NaN for

image

During import I also get warnings:

partitura/io/importkern.py:277: UserWarning: Part P2 already exists. Adding to previous Part.
partitura/io/importkern.py:277: UserWarning: Part P1 already exists. Adding to previous Part.

The first NaN seems to be caused by the editorials in measure 9

=8	=8	=8
*	*strophe	*
*	*^	*
*	*S/sic	*S/ossia	*
16DL	16f#xxL	8f#xx	8cc]L
16d	16dxxJ	.	.
*	*v	*v	*
*	*Xstrophe	*
16e-	4g	8b-J

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions