-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #915 from dchiller/i878-neume-exemplars
feat: add neume exemplars for omr neume search
- Loading branch information
Showing
21 changed files
with
1,115 additions
and
294 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
""" | ||
Functions for IIIF API boilerplate. | ||
""" | ||
|
||
|
||
def construct_image_api_url(image_uri: str, **kwargs: str | int) -> str: | ||
""" | ||
Construct a IIIF image API request URL from an Image URI and | ||
a set of apotion IIIF Image API parameters. Works with the Image | ||
API v2 and v3. | ||
Required parameters: | ||
- image_uri: The URI of the image to request. | ||
Optional parameters (see API docs, eg. https://iiif.io/api/image/2.1/): | ||
- region: The region of the image to request. Region should be a string | ||
that conforms to the IIIF Image API specification (see link above). | ||
- size: The size of the image to request. | ||
- rotation: The rotation of the image to request. | ||
- quality: The quality of the image to request. | ||
- format: The format of the image to request. | ||
Returns: | ||
The constructed IIIF image API request URL. | ||
""" | ||
region = kwargs.get("region", "full") # Default to full image | ||
size = kwargs.get("size", "pct:50") # Default to 50% of the original size | ||
rotation = kwargs.get("rotation", "0") # Default to no rotation | ||
quality = kwargs.get("quality", "default") # Default to default quality | ||
img_format = kwargs.get("format", "jpg") # Default to JPEG format | ||
return f"{image_uri}/{region}/{size}/{rotation}/{quality}.{img_format}" |
247 changes: 0 additions & 247 deletions
247
app/public/cantusdata/management/commands/pick_neume_exemplars.py
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
app/public/cantusdata/migrations/0004_alter_neumeexemplar_options_neumeexemplar_order.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 5.0.7 on 2024-09-19 18:10 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("cantusdata", "0003_chant_differentiae_database"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name="neumeexemplar", | ||
options={"ordering": ["order"]}, | ||
), | ||
migrations.AddField( | ||
model_name="neumeexemplar", | ||
name="order", | ||
field=models.IntegerField( | ||
default=1, | ||
help_text="A helper field used to order the exemplars.\n See helpers/neume_helpers.py for an explanation of how this is used.", | ||
), | ||
), | ||
] |
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
Oops, something went wrong.