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

Set Up MVP Package For Label-Image Creation #5

Open
wants to merge 32 commits into
base: main
Choose a base branch
from

Conversation

AFg6K7h4fhy2
Copy link
Owner

@AFg6K7h4fhy2 AFg6K7h4fhy2 commented Oct 19, 2024

This PR constitutes a first-pass at adding:

  • An abstract Label class.
  • A Label for collected specimens called CollectionsLabel.
  • A Label for systematics called SystematicsLabel.
  • Utility functions for working with and generating multiple labels.
  • A notebook with label creation examples, including re-creating labels found on the Fossil Forum and other places.

@AFg6K7h4fhy2 AFg6K7h4fhy2 added first-pass A first-pass at a specific task; typically evolves into something more substantial later. feature A new tool or utility being added. labels Oct 19, 2024
@AFg6K7h4fhy2 AFg6K7h4fhy2 added this to the [October 14, October 25] milestone Oct 19, 2024
@AFg6K7h4fhy2 AFg6K7h4fhy2 self-assigned this Oct 19, 2024
@AFg6K7h4fhy2 AFg6K7h4fhy2 linked an issue Oct 19, 2024 that may be closed by this pull request
@AFg6K7h4fhy2
Copy link
Owner Author

The following comment details an issue being experienced.

Presently, Label is an abstract base class for CollectionsLabel. Label has many attributes and CollectionsLabel of course has some other, more specific attributes. When a user creates a CollectionsLabel, there should not be much needed if they want to make use of the default values for the CollectionsLabel specific parameters. Also, they should be able to change the order of the parameters to suit the order in which they want the group titles (e.g. "Collection" to appear).

As an example,

label1 = paleo_utils.CollectionsLabel(
    save_directory="../assets/saved_images/",
    id_number="2131",
    collection="AMNH",
    collector="Dr. Montague",
    location="Europe",
    coordinates=(40.7128, -74.0060),
    date_found="2023-01-01",
)

Should output the following:

ID: 2131
Collection: AMNH
Collector: Dr.Montague
Location: Europe
Coordinates: (40.7128, -74.0060)
Date Found: 2023-01-01

Changing the order in the paleo_utils.CollectionsLabel() call should change the output order. The problem I am having is in trying to determine whether the parameter name e.g. location in location= should be turned in the group title. There are certain parameters that aren't groups, such as coordinates_separate: bool = False which guides where the coordinates occur.

An idea is to have a class for a default label be separate from the class CollectionsLabel. The class CollectionsLabel then receives a blank label instance and can use that as the place to add the label.

Further thoughts will come soon.

@AFg6K7h4fhy2
Copy link
Owner Author

The solution to the aforementioned issue is to probably work with calls like the following:

label2 = paleo_utils.CollectionsLabel(
    collection="AMNH",
    id_number="12345",
    collector="Dr. Larson",
    custom_titles={
        "collection": "Repository: ",
        "id_number": "Catalog: ",
        "collector": "Finder: "
    }
)

@AFg6K7h4fhy2
Copy link
Owner Author

I asked a question on Code Review.

@AFg6K7h4fhy2
Copy link
Owner Author

AFg6K7h4fhy2 commented Nov 6, 2024

This comment has been moved to the issue associated with this PR.

See here: #2 (comment).

@AFg6K7h4fhy2 AFg6K7h4fhy2 added the High Priority A task that is of higher relative priority. label Nov 6, 2024
@AFg6K7h4fhy2
Copy link
Owner Author

Since it would not be nice to provide all the parameters covered in Label each time, having some templates available would be useful.

@AFg6K7h4fhy2
Copy link
Owner Author

AFg6K7h4fhy2 commented Nov 6, 2024

The workflow of Label creation needs to be better established. Does one make a Label, save the class, then reuse it each time they want to make a collections label or systematics label? This would imply that CollectionsLabel and SystematicsLabel might not be best of as their own classes.

@AFg6K7h4fhy2
Copy link
Owner Author

Some of the comments in this PR seem more fitting to have been made on the associated issue. In general, the author prefers considerations for "the task at hand" being made in the issue and comments regarding the code to accomplish this task be made in the PR. As such, the author has moved the Code Review comment(s) to the associated issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new tool or utility being added. first-pass A first-pass at a specific task; typically evolves into something more substantial later. High Priority A task that is of higher relative priority.
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Set Up MVP Package For Label-Image Creation
1 participant