Closed MSeal closed 5 years ago
TODO
comment in fb3dcf52e59fc57540b49380e5df948aaa407329 in #29. cc @MSeal.TODO
comment in fb3dcf52e59fc57540b49380e5df948aaa407329 in #29. cc @MSeal.TODO
comment in fb3dcf52e59fc57540b49380e5df948aaa407329 in #29. cc @MSeal.Merging #29 into master will increase coverage by
0.16%
. The diff coverage is95.02%
.
@@ Coverage Diff @@
## master #29 +/- ##
==========================================
+ Coverage 95.33% 95.49% +0.16%
==========================================
Files 7 7
Lines 257 355 +98
==========================================
+ Hits 245 339 +94
- Misses 12 16 +4
Code coverage dropped slight despite more tests. I think this was due to more error message code lines. It's still well above 90% so I'm not worried.
Whoa! Nice @MSeal. Will give a closer review this evening.
Yes we'll need python 2 support in scrapbook for papermill deprecation. I did some stats gathering and 1/5th of papermill downloads are to python 2 environments still. I think dropping python 2 support for both scrapbook and papermill at end-of-year when python 2 official support drops makes the most sense.
I think dropping python 2 support for both scrapbook and papermill at end-of-year when python 2 official support drops makes the most sense.
Let's add that tentative plan to the README and/or setup.py to signal that intent.
The only piece I wanted to dig into check on was that the media types matched well with the notebook format specification and limitations.
Right now this looks good for what's there as the types look like this:
application/scrapbook.scrap+json: JSONObject
application/scrapbook.scrap+unicode: string
For other encoders, they can only fit this pattern:
application/scrapbook.scrap+[name]: string
This is due to the fact that anything that doesn't end in +json
is forced to be a string in the notebook format.
This means that if you ever want an encoder to use json
under the hood like this:
{
"ref": "s3://..."
}
You'll be stuck writing it as an encoded string within the json notebook, because the notebook format has to (for legacy reasons) treat anything that doesn't end in +json
as a string.
Perhaps then we'd have a new ref
structure (?). An alternative to this is to always nest it under application/scrapbook.scrap+json
but where a scrap has a particular format like:
"application/scrapbook.scrap+json": {
"storage": "json",
"data": { "a": 2 }
}
"application/scrapbook.scrap+json": {
"storage": "arrow-by-ref",
"data": { "ref": "s3://.../" }
}
Note: my comment above shouldn't be taken to block this PR or effort, only to raise up some possibility of inflexibility that you might want to be aware of before making a call on this.
Wait...
You'll be stuck writing it as an encoded string within the json notebook, because the notebook format has to (for legacy reasons) treat anything that doesn't end in
+json
as a string.
Seriously?!?! uuuhhhggg. Ok this kind of makes sense and I didn't think about it much before, so ty for pointing that out.
Ok what about if we did "application/scrapbook.scrap.<encoder_type>+json"
? @rgbkrk
Ok what about if we did
"application/scrapbook.scrap.<encoder_type>+json"
?
Neat, I like that! Then each of those can choose whether they're represented with json or text (unless it's always going to be a structured object).
For now we'll just support the structured doc whose "data" key has JSON or text -- but the leaves us open to other top level formats.
This is a massive overhaul PR which takes in feedback from a lot of sources which I bundled together to save many potentially conflicting PRs being made. But the changes break down into these larger topics:
sketch
andglue
have merged intoglue
, andsnaps
are nowdisplay
attributes ofscraps
. The snaps vs scraps and glue vs sketch metaphors really tripped people up. I think now exposing the internal limitations of display objects by having a single data model from the user interface cleans this up a lot. Its much more straight forward to explain in the README now.TODO after merge:
ref
example and encoding model with a localfile reference