-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba6f1e4
commit 38d103a
Showing
3 changed files
with
24 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38d103a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts on DatePrimitive. First, I love it! Second, please make sure that all DatePrimitive-derived classes can be initialized with Dates, not just strings. They could before (and I use this facility in my Humdrum parser), but some of them were type-hinted so, and some were not. Third, it looks like str is returning space-delimited date strings for the different multiple-Date classes. At some point (maybe not now) it would be good to make these strings that can be parsed back into the appropriate DatePrimitive-derived class (without external knowledge of which class is appropriate). Humdrum has a nice string format for these (**zeit format, which is pretty much exactly what
load()
already knows how to parse), and I have some code that can convert between DateBlah and str, and then back to the appropriate DateBlah.38d103a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's that snippet of code:
M21ConvertSnippet.py.txt
38d103a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's got some stolen music21 code in it, but then it's enhanced.
38d103a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha -- yes, let's make sure of that too. But how would it work with DateBetween, and the >2 Dates one? OH, I suppose subclasses can be MORE lenient about what they accept as initialization, just not less. So they can take a list of Date elements as well, like they currently do. I'll get on that
38d103a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BSD license means you can't steal it. It's already free. :-D
38d103a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah -- that was a TODO I didn't finish. I even made a DateParseType for doing this.