Skip to content

Conversation

@leoguignard
Copy link
Member

In this:

  • Update to the new mastodon reader with micromastodonreader
  • possibility to change the labels with a pre-existing dictionary in the properties
  • possibility to change the labels with a given dictionary
  • possibility to list all the pre-existing dictionary that "fits"
  • the tests for the changes that were made

@codecov
Copy link

codecov bot commented Jul 25, 2025

Codecov Report

❌ Patch coverage is 83.78378% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.24%. Comparing base (2348260) to head (448e4c1).
⚠️ Report is 12 commits behind head on code-split-2.

Files with missing lines Patch % Lines
src/lineagetree/_basics/_navigation.py 82.14% 5 Missing ⚠️
src/lineagetree/_io/_loaders.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##           code-split-2      #84       +/-   ##
=================================================
- Coverage         96.77%   63.24%   -33.53%     
=================================================
  Files                 2       15       +13     
  Lines               341     2487     +2146     
  Branches             17        0       -17     
=================================================
+ Hits                330     1573     +1243     
- Misses                6      914      +908     
+ Partials              5        0        -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -763,16 +763,17 @@ def read_from_tgmm_xml(


def read_from_mastodon(
Copy link
Collaborator

Choose a reason for hiding this comment

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

If understand this correctly it only reads one label set, right? If yes maybe we can read every label?

Comment on lines 400 to 418
def available_labels(lT: LineageTree) -> list[str]:
"""Returns the list all the available label dictionaries

Returns
-------
list of string
list of the names of all the available properties
to label the nodes
"""
available_labels = []
for prop_name, prop in lT.__dict__.items():
if (
0 < len(prop_name)
and prop_name[0] != "_"
and isinstance(prop, dict)
and 0 < len(prop)
and all(isinstance(k, int) for k in prop.keys())
and all(isinstance(v, str) for v in prop.values())
):
Copy link
Collaborator

Choose a reason for hiding this comment

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

See next comment. I think we should have a specifc class for the labels, called available labels or something.

Comment on lines 441 to 443
.. warning:: The labels are changed in place.
Therefore, the former labels dictionary was not
saved it is lost.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Related to my previous comment, I think that you should have all the labels in one place, and then change them whenever and when you change labels you should save the old ones (so you can use different labelling systems). A solution like this could be far easier because:
lT.labels = available_labels[i] to do this we should make a special class so that we only accept assignment of labels if it comes from a specific class)

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think I fully understand your suggestion yet.
All the labels are already in one place (LineageTree) granted they are with other things but still, they are all in one place.
When you write lT.labels = available_labels[i] do you mean the user would do that?
If yes how would he build available_labels, if he doesn't build it, where would he find it?
How would he modify it?
How that would be attached to a specific instance of LineageTree?
If the user can modify it, how would we make sure that they do it correctly?

There are too many unkown to understand your suggestion.

Also, the .. warning:: is not relevant anymore, we keep the labels after change.

@leoguignard leoguignard merged commit b28517e into code-split-2 Jul 28, 2025
1 of 3 checks passed
@leoguignard leoguignard deleted the mastodon-reader-and-labeling-change branch July 28, 2025 08:52
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.

2 participants