-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add a folder of outputs to acro #130
Conversation
Codecov Report
@@ Coverage Diff @@
## main #130 +/- ##
==========================================
+ Coverage 97.14% 97.20% +0.05%
==========================================
Files 6 6
Lines 666 680 +14
==========================================
+ Hits 647 661 +14
Misses 19 19
|
@rpreen I would like your advice on something, please. The problem: The solution (now):
Do you think there is a better solution? |
Maybe have the user specify both In another PR, we need to prompt to ask the user if they are ok with overwriting or changing the |
acro/record.py
Outdated
for root, _, files in os.walk(os.getcwd()): | ||
if root != os.path.join(os.getcwd(), path) and filename in files: | ||
shutil.copy(os.path.join(root, filename), path) | ||
output.append(Path(os.path.join(root, filename)).name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wont work if (a) If the file doesn't exist (b) the file is in a folder in a parent directory (c) what if there are multiple subdirectories which have the same filename - it'll just use the first one found? There is also no warning if any of these things happen, it just doesn't make it to the destination folder.
Actually, I think if the file doesn't exist the current custom_output()
will just pretend to add the file without actually checking whether it exists so we should fix that here too...
for more information, see https://pre-commit.ci
Signed-off-by: mahaalbashir <mahaalialbashir@gmail.com>
for more information, see https://pre-commit.ci
Signed-off-by: mahaalbashir <mahaalialbashir@gmail.com>
Signed-off-by: mahaalbashir <mahaalialbashir@gmail.com>
acro/record.py
Outdated
self.output_id += 1 | ||
logger.info("add_custom(): %s", output.uid) | ||
else: | ||
logger.info("The file %s doesn't exists", filename) # pragma: no cover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the message should be more explicit:
logger.info("WARNING: Unable to add %s because the file does not exist", filename)
Part of me thinks this should be using warnings.warn()
but then I think it will print the source line in record.py
which is probably too much info for the researcher here
Create a function that: