Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove_invalid() makes object even more invalid #49

Closed
cifkao opened this issue Jan 8, 2021 · 2 comments · May be fixed by #47
Closed

remove_invalid() makes object even more invalid #49

cifkao opened this issue Jan 8, 2021 · 2 comments · May be fixed by #47
Labels
bug Something isn't working

Comments

@cifkao
Copy link
Contributor

cifkao commented Jan 8, 2021

Check this out:

>>> m = muspy.Music(tracks=[muspy.Track(notes=[
    muspy.Note(time=-2, pitch=58, duration=19, velocity=99),
    muspy.Note(time=-1, pitch=65, duration=20, velocity=65),
    muspy.Note(time=0, pitch=67, duration=23, velocity=65),
])])
>>> m.remove_invalid()
Music(metadata=Metadata(schema_version='0.0'), resolution=24, tracks=[Note(time=0, pitch=67, duration=23, velocity=65)])

The valid note somehow gets added to the track list, and the track itself gets removed.

Not sure why this is happening, but #47 seems to fix it.

@salu133445
Copy link
Owner

Looks like a bug. Will check the pull request. Thanks.

@salu133445 salu133445 added the bug Something isn't working label Jan 11, 2021
@salu133445
Copy link
Owner

This has been fixed by 8899576.

Note: When applying recursively, we have to modifying the lists in place so that their references remain unchanged.

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

Successfully merging a pull request may close this issue.

2 participants