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

Search syntax documentation #432

Conversation

fabiovincenzi
Copy link
Collaborator

fixes #327

@fabiovincenzi fabiovincenzi linked an issue Oct 10, 2023 that may be closed by this pull request
| ```duration``` | Run duration in seconds | ```numeric```|
| ```created_at``` | Run creation datetime | ```numeric``` |
| ```finalized_at``` | Run end datetime | ```numeric``` |
| ```metrics``` | Set of run metrics | ```dictionary``` |
Copy link
Contributor

Choose a reason for hiding this comment

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

can these be given table-like format in the markdown source, too? ie, lining up the columns

Copy link
Collaborator

@dsuhinin dsuhinin left a comment

Choose a reason for hiding this comment

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

What do you think about to add search_ prefix to each png file so it will be much easy to navigate and understand to which doc this images belong?

### Run parameters
Run parameters could be accessed via attributes.
```python
run.hparams.param1 >= 64
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo? hparams? should be just params.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually should be just param1 I'll fix that

@@ -0,0 +1,228 @@
# Search Syntax Documentation

## Introduction
Copy link
Collaborator

Choose a reason for hiding this comment

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

what do you think about to have a glossary with links so you can easily jump to any section? not a requirement but just a thought if I want to quickly check special section.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes! I'll add it

Comment on lines 223 to 228
### Filter Metrics by run
You can also filter the metrics by combining metric attributes with run attributes.

Showing the metrics with the last value greater than 6 belonging to a run with the name that starts with marvelous.

![FastTrackML Metric List filter by metric and run attributes](images/metrics_filter_by_run.png)
Copy link
Collaborator

Choose a reason for hiding this comment

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

what do you think to a like a complex query with different operators and cases?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep

suprjinx
suprjinx previously approved these changes Oct 11, 2023
Copy link
Contributor

@suprjinx suprjinx left a comment

Choose a reason for hiding this comment

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

looks great

Copy link
Member

@jgiannuzzi jgiannuzzi left a comment

Choose a reason for hiding this comment

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

Great stuff!

## Operations

### String operations
For the ```string``` attributes you can use the following comparing operator:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
For the ```string``` attributes you can use the following comparing operator:
For the ```string``` attributes you can use the following comparison operator:

(there are multiples places where this comment applies)

- ``` <= ```

### Boolean operations
For the ```boolean``` attributes you can use the following comparing operator:
Copy link
Member

Choose a reason for hiding this comment

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

Please also document that having no operator or a unary operation also works for booleans, e.g. run.archived is the same as run.archived == True, and !run.archived is the same as run.archived == False


### Example with ```run.duration``` (numeric)

Select only the runs where the duration is exactly 111111111
Copy link
Member

Choose a reason for hiding this comment

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

Use something more realistic, like 60

```

### Run parameters
Run parameters could be accessed via attributes.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Run parameters could be accessed via attributes.
Run parameters can be accessed via attributes.

Run parameters could be accessed via attributes.
![FastTrackML Run List, param filter](images/search_runs_param_filter.png)

### Filtering Runs with Unset Attributes
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
### Filtering Runs with Unset Attributes
### Filtering Runs with Unset Parameters

(there are multiples places where this comment applies)

Comment on lines 179 to 180
- ``` .match() ```
- ``` .search() ```
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- ``` .match() ```
- ``` .search() ```
- ``` re.match() ```
- ``` re.search() ```


- run.archived can be either True or False.
- The duration of run must be greater than 0.
- The run has to contain a metric named 'TestMetric' and is value of last must be greater than 2.5.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- The run has to contain a metric named 'TestMetric' and is value of last must be greater than 2.5.
- The run has to contain a metric named 'TestMetric' and its last recorded value must be greater than 2.5.

## Introduction

This document provides an overview of the search syntax that users can utilize to filter metrics and runs.

Copy link
Member

Choose a reason for hiding this comment

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

We should start by introducing that the syntax is essentially Python "so it should feel pretty intuitive for most users", and then explain that we'll dive into more details about supported operations below.



## Search Runs
You can filter the runs using the following run attributes:
Copy link
Member

Choose a reason for hiding this comment

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

We should make it clear that these are attributes for the run object

| ```metrics``` | Set of run metrics | ```dictionary``` |

## Search Metrics
You can filter the metrics using the following metric attributes:
Copy link
Member

Choose a reason for hiding this comment

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

We should make it clear that these are attributes for the metric object

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.

Documentation of search syntax
4 participants