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

Markers/wrap up #10062

Merged
merged 6 commits into from
Nov 2, 2021
Merged

Markers/wrap up #10062

merged 6 commits into from
Nov 2, 2021

Conversation

ka-bu
Copy link
Contributor

@ka-bu ka-bu commented Nov 2, 2021

Proposed changes:

  • connect cli and markers
  • cleanup: remove unused types/schemata/...

Status (please check what you already did):

  • added some tests for the functionality
  • updated the documentation
  • updated the changelog (please check changelog for instructions)
  • reformat files using black (please check Readme for instructions)

@ka-bu ka-bu requested a review from usc-m November 2, 2021 16:52
@ka-bu ka-bu requested a review from a team as a code owner November 2, 2021 16:52
@ka-bu ka-bu removed the request for review from a team November 2, 2021 16:52
@@ -120,30 +124,32 @@ def _run_markers(
strategy: Strategy to use when selecting trackers to extract from.
config: Path to the markers definition file to use.
output_filename: Path to write out the extracted markers.
stats_file: (Optional) Path to write out statistics about the extracted
markers.
stats_file_prefix: (Optional) Prefix of paths to write out statistics about the
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is a bit unclear since a path prefix is a different thing to what we're talking about here (a path, with a prefix to be appended to a file name)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

any suggestion for a nice name? :/

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the name is fine, but the docs should maybe read differently - it's a bit complicated because this is bundling two separate things in, a path, and the name prefix. Maybe something like "The path where stats files should be stored, and a prefix used to construct the stats file names" or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tried to add that to both the docstr and the help text with an example. A bit lengthy now but should be clearer now?

session_stats_file=_append_suffix(stats_file_prefix, STATS_SESSION_SUFFIX),
overall_stats_file=_append_suffix(stats_file_prefix, STATS_OVERALL_SUFFIX),
)
except (FileExistsError, NotADirectoryError) as e:
Copy link
Contributor

Choose a reason for hiding this comment

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

Neat 😎

contained in a directory that does not exist
"""
# Check files and folders before doing the costly swipe over the trackers:
for path in [session_stats_file, overall_stats_file, output_file]:
Copy link
Contributor

Choose a reason for hiding this comment

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

So I put this in the CLI because I figured it would let us have a flag to allow the user to force an overwrite, do we want to bother adding in that feature right now or put it on the list of future enhancements?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like the idea :D (had also put an overwrite parameter to the stats :D) - But since it wasn't in the list of requirements, let's just ignore it for now

@ka-bu ka-bu requested a review from usc-m November 2, 2021 17:51
Copy link
Contributor

@usc-m usc-m left a comment

Choose a reason for hiding this comment

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

LGTM

@ka-bu ka-bu enabled auto-merge (squash) November 2, 2021 17:57
@ka-bu ka-bu disabled auto-merge November 2, 2021 18:02
@ka-bu ka-bu enabled auto-merge (squash) November 2, 2021 18:48
@ka-bu ka-bu merged commit fd465bb into main Nov 2, 2021
@ka-bu ka-bu deleted the markers/wrap-up branch November 2, 2021 19:16
indam23 pushed a commit that referenced this pull request Jul 27, 2022
* connect stats and cli; rm unused types from marker.py; ...

* rm unused schemata

* try to improve docstr/help

* Fix stats CLI command inversion

* fix help test (nargs=? -> stats file prefix is optional)

Co-authored-by: Matthew Summers <m.summers@rasa.com>
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