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

Adds args for intermediate objects #139

Merged
merged 7 commits into from
Dec 24, 2022
Merged

Adds args for intermediate objects #139

merged 7 commits into from
Dec 24, 2022

Conversation

helrond
Copy link
Contributor

@helrond helrond commented Dec 9, 2022

Adds arguments for Annotation and AnnotationPage.

I didn't add **kwargs for AnnotationHelpers.add_annotation because we're already passing in a pre-fab Annotation object, so since we're not creating an Annotation from scratch it makes less sense to do that (IMO). Happy to be contradicted though.

Fixes #111

Copy link
Member

@digitaldogsbody digitaldogsbody left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks Hillel :) I agree with the rationale for not passing **kwargs to add_annotation.

Can we add the anno_page_id also to the make_annotation helper so that it can be passed through even when you don't have an Annotation object pre-created, when that function calls the now-fixed add_annotation?

Copy link
Contributor

@giacomomarchioro giacomomarchioro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks very good to me! That are only two observations that come to my mind but probably is better to address them in a separate issue:

  1. in the case of a Canvas you can add an Annotation to the items or to the annotations list. How can you differentiate? In this case, the Annotation helper is inserting by default the annotation to the annotations list.
  2. shall we provide the ability to set the format and the id of the body as args of the function, in case I want to show lower resolution or rotated images in the create_canvas_from_iiif?

@helrond
Copy link
Contributor Author

helrond commented Dec 13, 2022

OK, after (too many) commits, I think I address @digitaldogsbody's comment.

@giacomomarchioro - I agree these are separate issues!

@digitaldogsbody
Copy link
Member

1. in the case of a Canvas you can add an Annotation to the `items` or to the `annotations` list. How can you differentiate? In this case, the Annotation helper is inserting by default the annotation to the annotations list.

I think that make_canvas/add_canvas should cover the first, and make_annotation/add_annotation the second.

2. shall we provide the ability to set the format and the id of the body as args of the function, in case I want to show lower resolution or rotated images in the create_canvas_from_iiif?

This is a good idea - maybe also a separate helper targeted at the annotation body SpecificResource instance that allows manipulation after (in the manner of the set_hwd helpers)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow setting intermediary id properties with multi-level helpers
3 participants