Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Can I Make A Super Small Fr Or See If This Already Exists. I Want To Ensure/Add A Tag On A Run, But There Is No Add_Tag. Set_Tags Allows Duplication, Which Isnt Something I Think Is Useful With Tags (And Cant Be Done On The Ui I Believe). Currently, I Si

Can I make a super small FR or see if this already exists. I want to ensure/add a tag on a run, but there is no add_tag. set_tags allows duplication, which isnt something I think is useful with tags (and cant be done on the UI I believe).

Currently, I simple call this code:

best_task.set_tags(list(set(best_task.get_tags() + ["best"])))

Which seems far more verbose than a simple

best_task.add_tag("best") method would be. Is there a different way to ensure a tag? Would this be a good issue for a PR to be raised to add that method into the Task class?

  
  
Posted 3 years ago
Votes Newest

Answers 13


How odd, its not in my task.py file!

Let me check…

Ah. The code inspector is jumping to backend_interface.task.py, not clearml.task.py, how embarrassing for me!

  
  
Posted 3 years ago

They inherit from one another, so it does make sense. Also the add_tags is on the "main" Task and not the backend parent

  
  
Posted 3 years ago

Notice that if you pass string it will split it based on spaces

  
  
Posted 3 years ago

No worries πŸ™‚

  
  
Posted 3 years ago

Pycharm does get confused sometimes

  
  
Posted 3 years ago

Yup, I see. My apologies for not catching that before posting πŸ™‚

  
  
Posted 3 years ago

BTW: the new documentation should contain a full search over the docstring

  
  
Posted 3 years ago

Oh btw the set_system_tags we talked about previously to auto-archive by adding the archived tag is throwing me an error.

for t in top_exp: t.set_tags(t.get_tags() + ["trial"]) t.set_system_tags(t.get_system_tags() + ["archived"])With error: ValueError: Task object can only be updated if created or in_progress

I think its because the _edit call happens after the set_task_property call?

  
  
Posted 3 years ago

Ah fantastic, Ill use that over IDEs suggestions from now on πŸ™‚

  
  
Posted 3 years ago

Just fixed, will be merged later, basically some field you are not supposed to change post execution (but system tags should be exempt from that). The SDK checks before the backend does, so you get a nice error πŸ™‚ anyhow the backend will obviously allow it

  
  
Posted 3 years ago

Awesome ,thanks mate

  
  
Posted 3 years ago