-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
The following comment details an issue being experienced. Presently, 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:
Changing the order in the An idea is to have a class for a default label be separate from the class 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: #5 (comment) So that the answer to the CR question doesn't become lost, I've reproduced it below: Code Review Answeruse pathlib
Rather than Kudos on using ISO8601, so lexical order matches chronological order. optional valuesYou consistently admit of I encourage you to go back and reconsider whether a CollectionsLabel truly could have e.g. no data typeSeveral date fields curiously use I imagine Giving idiomCertainly this works,
but it is more usual to iterate over But it's not clear why you'd want to make a copy at all, given that each function call makes a shallow copy already. The OP contains no unit test which would turn Red if we stop copying. If you are trying to conform to some documented attrs advice, then please add a (In an inheritance situation is common enough for a V2 child class to destructively zero itemsYou have declared that
No need for the guard, there. Just iterate over zero items in an empty dict, no harm done. Please phrase the Wouldn't a simple .update() suffice here? meaningful identifier
That looks more like you're creating a new Also, rather than merge that code fragment into the isinstance()
Please simplify to
(Your IDE will help you add embedded newlines
I note in passing that you apparently prohibit certain characters in all those fields, such as NEWLINE, but that wasn't enforced anywhere. If one crept in, it would corrupt this returned value, turning a single record into apparently multiple records. Overall this seems a reasonable design.
You didn't mention your target environment, but I'm willing to assume it does not include e.g. Jython, and will be restricted to just modern cPython. The python language distinguishes between unordered Starting with interpreter 3.7, So, yes, your expectation is reasonable. |
Since it would not be nice to provide all the parameters covered in |
The workflow of Label creation needs to be better established. Does one make a |
This PR constitutes a first-pass at adding:
Label
class.CollectionsLabel
.SystematicsLabel
.