ENH: Add possibility to turn section invisible#288
Conversation
Sections of model cards have an additional flag called visible. It is by default True but if set to False, the corresponding section, and its subsections, are not rendered. In contrast to deleting those section, turning them invisible will not remove them from the underlying data dict. This is useful because it allows us to restore those sections to exactly their previous place. In contrast, if we delete and add them again, they may end up in a different position, because the order of the underlying dict can change. At the moment, the feature is not used anywhere in skops. I plan, however, to use it for a model card creation space, where it would be quite useful to have.
|
@skops-dev/maintainers ready for review |
merveenoyan
left a comment
There was a problem hiding this comment.
I think we can merge, this looks like a small and straightforward change. Would be nice to document later on after the Space is out.
|
@BenjaminBossan Does this mean users need to first add a section, then |
|
@adrinjalali Yes, basically there is no user API for making a section invisible yet. We can think about what would be the best way to do it. For now, I'm not sure if it needs to be exposed to users, let's perhaps wait and see if there is a need? At the moment, this flag is used only for the model card space, because it allows to undo the deletion of a section. If we deleted a section by deleting it from |
Sections of model cards have an additional flag called
visible. It is by defaultTruebut if set toFalse, the corresponding section, and its subsections, are not rendered.In contrast to deleting those section, turning them invisible will not remove them from the underlying data dict. This is useful because it allows us to restore those sections to exactly their previous place. In contrast, if we delete and add them again, they may end up in a different position, because the order of the underlying dict can change.
At the moment, the feature is not used anywhere in skops. I plan, however, to use it for a model card creation space, where it would be quite useful to have.