Skip to content

Add <staff-details><staff-size> to API.#283

Open
rpatters1 wants to merge 2 commits into
webern:mainfrom
rpatters1:add-staff-size-to-api
Open

Add <staff-details><staff-size> to API.#283
rpatters1 wants to merge 2 commits into
webern:mainfrom
rpatters1:add-staff-size-to-api

Conversation

@rpatters1

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

Copy link
Copy Markdown

Coverage report

Core-dev coverage src/private/mx/core/

Metric Coverage Covered / Total
Lines 77.8% 28487 / 36624
Functions 74.3% 6349 / 8550
Branches 50.6% 22632 / 44725

API coverage src/private/mx/{api,impl,utility}/

Metric Coverage Covered / Total
Lines 78.4% 6035 / 7696
Functions 63.7% 2045 / 3210
Branches 47.7% 5127 / 10753

Core HTML report | API HTML report

Commit a8b03f5357d13de4db65f779c44d1e7c600bf38f.

@github-actions

Copy link
Copy Markdown

gen-quality gen/

gen-quality: 84.5 / 100   (floor 84.5, +0.0)

  structure     86.5  x0.50   [fn 90.5 / file 82.6]
  cyclomatic    88.4  x0.25
  cognitive     76.6  x0.25

  409 functions across 31 files, 7702 lines (largest file 1044)
  max cc 56  max cognitive 44  max fn loc 152

Worst offenders (top 5 per axis; full lists in score.json):
  cyclomatic gen/xsd/analyze.py:311     report                             56
  cyclomatic gen/plates/build.py:956    _validate_config_against_ir        35
  cyclomatic gen/press/context.py:145   plate_context                      34
  cyclomatic gen/__main__.py:46         _ir                                23
  cyclomatic gen/tests/test_ir.py:102   _check_references                  20
  cognitive  gen/xsd/analyze.py:311     report                             44
  cognitive  gen/ir/resolve.py:119      flat_elements                      40
  cognitive  gen/tests/test_ir.py:102   _check_references                  38
  cognitive  gen/press/context.py:145   plate_context                      37
  cognitive  gen/xsd/analyze.py:207     _sccs                              37
  size       gen/xsd/analyze.py:311     report                             152
  size       gen/press/context.py:145   plate_context                      96
  size       gen/plates/build.py:533    _value_plate                       89
  size       gen/plates/build.py:956    _validate_config_against_ir        89
  size       gen/ir/resolve.py:119      flat_elements                      78

Commit a8b03f5357d13de4db65f779c44d1e7c600bf38f.

@webern webern left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine. Just eyed it and left one question.

staffDetails.setGroup(sdg);
}

if (staffSize >= 0.0)

@webern webern Jun 30, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is >= correct (and not >)? Is zero valid and would we want to write it?

@rpatters1 rpatters1 Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I'm going to assume 0 is not valid and make changes accordingly. My question is whether we should use 0.0 as the sentinel rather than a negative value.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LLM says:

In MusicXML, is a non-negative-decimal, so 0 is schema-valid. Semantically it is odd: the element is a percentage of default staff scaling, so normal values are around 100, smaller staves might be something like 75, and 0 would mean a zero-height staff space. But because the schema allows non-negative values, the API sentinel should stay negative, and staffSize >= 0.0 is the right “specified” check.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could apply a stricter policy if you wish. It wouldn't bother me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants