-
Notifications
You must be signed in to change notification settings - Fork 6
an idea to guess if files / dirs are in / output #15
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
Merged
multimeric
merged 18 commits into
aCLImatise:master
from
bernt-matthias:topic/guess-in-or-out
Aug 25, 2020
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
fc2ac8e
an idea to guess if files / dirs are in / output
bernt-matthias a608d05
test for infer_type
bernt-matthias 73de563
test with pytest parametrisation
bernt-matthias f74c77b
subclass instead of property for outfiles/dirs
bernt-matthias 5c77c4c
change subclassing
bernt-matthias 3f55247
search for regular expression (instead of match)
bernt-matthias b793b36
style improvenents
bernt-matthias 186e567
don't search for read
bernt-matthias 83692f1
styling
bernt-matthias 21d0b60
fix tests
bernt-matthias 50f8493
require word boundaries for menay regular expressions
bernt-matthias edb2322
style improvements
bernt-matthias 6e99ddc
recognize int and float options if there is a int/float
bernt-matthias 5b39972
simplify test
bernt-matthias a4ff588
move default_re to correct branch
bernt-matthias 7a98903
check for integer and float values in the main if statement
bernt-matthias 7aaac45
add distinguish_inout foo to avoid code duplication
bernt-matthias 40fbc68
do not use unknown in/out
bernt-matthias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import pytest | ||
|
|
||
| from acclimatise.cli_types import ( | ||
| CliBoolean, | ||
| CliDir, | ||
| CliFile, | ||
| CliFloat, | ||
| CliInteger, | ||
| CliString, | ||
| ) | ||
| from acclimatise.model import infer_type | ||
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
|
bernt-matthias marked this conversation as resolved.
|
||
| "string,typ", | ||
| [ | ||
| ("", None), | ||
| ("int", CliInteger()), | ||
| ("size", CliInteger()), | ||
| ("length", CliInteger()), | ||
| ("max", CliInteger()), | ||
| ("min", CliInteger()), | ||
| ("str", CliString()), | ||
| ("float", CliFloat()), | ||
| ("decimal", CliFloat()), | ||
| ("bool", CliBoolean()), | ||
| ("file", CliFile()), | ||
| ("path", CliFile()), | ||
| ("input file", CliFile(output=False)), | ||
| ("output file", CliFile(output=True)), | ||
| ("folder", CliDir()), | ||
| ("directory", CliDir()), | ||
| ("output directory", CliDir(output=True)), | ||
| ("blah 23 blub", CliInteger()), | ||
| ("nonsense 23.42", CliFloat()), | ||
| (".42 gibberish", CliFloat()), | ||
| ("1E-5", CliFloat()), | ||
| ], | ||
| ) | ||
| def test_type_inference(string, typ): | ||
| inferred_type = infer_type(string) | ||
| assert inferred_type == typ | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.