-
Notifications
You must be signed in to change notification settings - Fork 153
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
declare source_hidden and outputs_hidden official code cell metadata #94
Conversation
@rgbkrk thanks for kicking this off! Some questions/thoughts: There were other attributes being discussed along with the input hiding:
I have been doing a bunch of work with user defined tags this weekend, and after that experience, I feel pretty strongly we should not use tags for things like this - it would pollute the users tag namespace in a way that would be very awkward. Previous names (the tag ones) were in the active tense such as Do I remember that we have decided that we will put any metadata into a jupyter namespace as well? My own preference would be the following:
|
I'd like to do the smallest amount of migrations as possible, so I'm happy to keep the old name for a
👍
What do you mean by not output area metadata? As in metadata for a single output (rather than cell)?
👍
Definitely in agreement with that one. A frontend can expose this as a toggle that enables both of As for the |
Ohhh, yeah, that is separate I guess.
There is separate output level metadata with one field currently: http://nbformat.readthedocs.io/en/latest/format_description.html#output-metadata
What isn't clear to me is do we move other, existing metadata into the new jupyter sub-dict? |
I think in the short term we should make |
+1
…On Mon, Jun 5, 2017 at 7:42 PM, Kyle Kelley ***@***.***> wrote:
What isn't clear to me is do we move other, existing metadata into the new
jupyter sub-dict?
I think in the short term we should make input_hidden and output_hidden
be in the jupyter namespace while we deprecate the other fields as part
of a minor change in the format. Later we can move them all into the
jupyter namespace and call it a major change in the format.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#94 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABr0JMXuJ74GnqaRK-DaDFGVxIt2j3nks5sBLyLgaJpZM4NwmW9>
.
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]
|
This sounds like a good plan to me. NB: There are other output level metadata keys that are used by different kernels (including the IPython kernel). This is particularly relevant for mimetype-keyed metadata. I'd suggest that we have I also want to implement a similar |
Now that I'm moving this, I'm thinking it should be It would then be |
Let me know what you both think of matching the names of the other fields here, since I diverted from the original name proposed. The last commit shows it in the jupyter namespace as well. |
Adding a test now while I'm at it. |
I do think there should be a way to hide markdown cells. It may be that people want to use that in a pedagogical context (e.g., show/hide solutions or derivations) like @willingc mentioned at the dev meeting last week. |
Yes, but I think that is fully covered by the `source_hidden` as the
`source` attribute contains the markdown source as well.
…On Tue, Jun 6, 2017 at 11:41 AM, M Pacer ***@***.***> wrote:
I do think there should be a way to hide markdown cells. It may be that
people want to use that in a pedagogical context like @willingc
<https://github.com/willingc> mentioned at the dev meeting last week.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#94 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABr0De0sqaQbU7Ajg1c10YhBVVTVw4Yks5sBZ1SgaJpZM4NwmW9>
.
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]
|
|
Yes, there is that third piece of state for markdown cells (editing versus
rendered) that isn't stored in the document, but the idea of hiding it is
the same, which I think of as "hide the input source, or any alternative
(rendered) representation of it"
…On Tue, Jun 6, 2017 at 2:49 PM, Kyle Kelley ***@***.***> wrote:
source_hidden on markdown has a bit different of a semantic since we tend
to think of it as "rendered" vs. "editing". I've added source_hidden for
markdown cells just now, though the meaning may be a bit different.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#94 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABr0MG4HrBYwV-1LW316afvt6i2okUSks5sBclbgaJpZM4NwmW9>
.
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]
|
Should we stick the markdown part of this discussion in a separate PR or just go with all the options presented here? |
I think putting it all in one PR makes sense. Should we also add the The last bit would be to add verbiage about this to the sphinx docs. |
* source_hidden * outputs_hidden
Updated, rebased. I'll handle the docs next. |
Documentation updated. I have to admit after updating the docs that the |
Forget to push the docs? I can read through and see how the jupyter namespace feels. |
Just saw it - yeah I see what you mean. It sort of seems like all of the formally specified metadata is the jupyter stuff. An different approach would be to tell folks that jupyter owns the top level keys and that they need to put all of their stuff in a namespace that doesn't collide with our keys. I am fine with that. |
Yeah sorry the GitHub outage was right when I pushed and was writing this comment. I did both in the opposite order when GitHub came back. |
I agree with this vision...
Can't we try to do this in one step, maybe? Or do you think is too much disrupting? |
I'm with Damian. It feels weird to have these new metadata values in a namespace, but I'm basically only 👎 for anything which is not consistent. |
Definitely +1 for consistency.
Which is essentially doing the same thing as namespacing official things off from other metadata namespaces. However, then we make every other third party pay this extra price of awkwardness of having a leading $ on top of their namespaces, instead of us paying the same price everyone else of having a top-level namespace. I think I'd still rather move to having a We could also move these special fields out of the metadata key, and make the metadata key solely reserved for third-party namespaces. |
Coming from the mailing list (thanks @ellisonbg for mentioning it there!) ... 👍 for putting official Jupyter stuff into the top-level namespace, 👎 for forcing something awkward like leading $ for third-party metadata. Except for silly project names like As a third-party author, I would naturally add my project name as a prefix or sub-namespace anyway, and as a matter of fact, I did exactly that (I'm not sure, but this was probably even suggested somewhere in the docs?). |
Here is a jupyterlab implementation of input/output hiding: Right now this is view only state, but once we decide on the metadata we can persist it to the metadata. |
Thinking a bit more...doesn't the new |
To me collapsed means truncated (in view only): render() {
return (
<Outputs
height="100px"
scrollable="totes"
/>
);
} whereas hidden means: render() {
return null;
} |
I agree with @rgbkrk comment above, I think collapsed and hidden are different concepts. Maybe we should be more clear at the time to define it/explain it. |
If we are to make a namespace requirement for 3rd party metadata do Jupyter
subprojects that are nonetheless progressing somewhat independently in
their design also have to adhere to it, e.g., nbgrader, RISE, etc.?
If we are going to require that, we should make an explicit list of banned
project names now and make that part of the spec, so that extension authors
can know that they are safe at least up until this point in the spec.
It also would be nice to have an explicit mechanism for automatically
reclaiming namespaces as part of the spec if that changes. For example,
postpending "-extension" to the original tag as part of nbformat version
upgrades. Then we can give a top-level metadata querying API (rather than
relying on authors to define their own calls into the json structure), and
we can equip that to first check for the "-extension" postfixed version of
the metadata namespace and only if not present does it then look for the
standard namespace they expected to find. This way extension authors can
code defensively to look for either their current name or their name with
the postfix by just using a single API where we've included the future
compatibility to handle any changes in our namespacing practices.
…On Wed, Jun 21, 2017 at 03:49 Damian Avila ***@***.***> wrote:
I agree with @rgbkrk <https://github.com/rgbkrk> comment above, I think
collapsed and hidden are different concepts. Maybe we should be more clear
at the time to define it/explain it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#94 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACXg6Gt5fKKj1rR04CRAXG59PGjsOaDZks5sGPUugaJpZM4NwmW9>
.
|
The namespace requirement is for fields where we are going to have a strict adherence to the specification we outline (and that others can contribute to, becoming part of "we"). |
I talked with @rgbkrk yesterday and we both feel that the current state of this PR is worth merging. There are larger discussions about the notebook format as it relates to the purpose of metadata and where to put it, but these particular attributes are a huge blocker for us right now in JupyterLab and nteract. Because this PR is a strict improvement and won't prevent or hinder future changes to the format, I am going to merge (@rgbkrk concurs with this decision). |
Thanks all! |
can we have guarantees that the jupyter metadata will be present in all
cells in notebooks versions 4.4 and up? even if it doesn't have either of
these particular metadata values?
…On Fri, Jul 21, 2017 at 2:07 PM, Kyle Kelley ***@***.***> wrote:
Thanks all!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#94 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACXg6NvqXk-4gifudx7UZiRPqS3n8pELks5sQRMBgaJpZM4NwmW9>
.
|
The only way we can have a guarantee is if we bump the nbformat by a major version. If and when we do that, we should probably move it out of metadata and into the top level portion of a cell where it really belongs as core functionality. |
On Friday, July 21, 2017, Kyle Kelley ***@***.***> wrote:
The only way we can have a guarantee is if we bump the nbformat by a major
version. If and when we do that, we should probably move it *out* of
metadata and into the top level portion of a cell where it really belongs
as core functionality.
Re: major version bump
It would be helpful if the notebook would also generate a stable identifier
(e.g `# x1y2z3` ) for each cell? There would then be a stable URI for each
cell and its metadata.
… —
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#94 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AADGy4UmazCNPzzL7K8gmEAkxtoaBfIGks5sQTqtgaJpZM4NwmW9>
.
|
Cell ids are not part of this issue, please stay on topic or find the relevant issue to comment on. |
On Sunday, July 23, 2017, Kyle Kelley ***@***.***> wrote:
Cell ids are not part of this issue, please stay on topic or find the
relevant issue to comment on.
Is this suggestion relevant to the thread context?
Adding identity to the things that metadata are attached to is relevant to
a major version bump in context to a discussion regarding changing the
metadata structure. If/when that happens, that would be a good time to add
stable identifiers to the next nbformat major version.
Is this suggestion (which certainly deserves another ticket) blocking the
current issue? No.
But if you're going to change cell metadata, that would be a good time to
also add stable identity (URI #fragment keys (JSONLD)) to the literate
programming things with source_hidden metadata.
… —
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#94 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AADGy1EOvlEanfI5VyYxtkCLMO05t0Ciks5sQ4HxgaJpZM4NwmW9>
.
|
This pull request has been mentioned on Jupyter Community Forum. There might be relevant details there: |
Following discussion from Jupyter Team Meeting, here's a follow on PR for the metadata I'd like to see us standandardize on.
This PR uses
source_hidden
within.cells[].metadata.input_hidden
, only for code cells (since markdown and raw cells imply hidden by default in most views (I'd be happy to add it to markdown if someone wanted it to be explicit though...)xrefs:
/cc @ellisonbg @mpacer @jcb91