Open AFg6K7h4fhy2 opened 1 month ago
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.
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: "
}
)
I asked a question on Code Review.
Re: https://github.com/AFg6K7h4fhy2/Paleo-Utils/pull/5#issuecomment-2453302370
So that the answer to the CR question doesn't become lost, I've reproduced it below:
Since it would not be nice to provide all the parameters covered in Label
each time, having some templates available would be useful.
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.
This PR constitutes a first-pass at adding:
Label
class.CollectionsLabel
.SystematicsLabel
.