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

add a warning in case the considered run is not in the summary table #153

Merged
merged 10 commits into from
May 10, 2022

Conversation

marialainez
Copy link
Collaborator

No description provided.

osa/paths.py Outdated
date_string = summary_table[summary_table["run_id"] == run_id]["date"][0]
except IndexError:
log.warning(f"Run {str(run_id)} is not in the summary table. Assuming the date of the run is {options.date}.")
date_string = options.date
Copy link
Member

Choose a reason for hiding this comment

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

I think that options.date is now a datetime object, so I'm not sure whether you can simply use the replace method for strings. Let's see if tests pass.

osa/paths.py Outdated Show resolved Hide resolved
@morcuended
Copy link
Member

You have to remove the expected failing test as well since now we assume that the date would be options.date

with pytest.raises(IndexError):
    get_run_date(1200)

Also related to the options.date conversion to YYYYMMDD you could do:

from osa.utils.utils import date_to_dir
night_dir = date_to_dir(options.date)

@morcuended
Copy link
Member

remove also the unused import pytest (pyflakes is complaining)

@codecov
Copy link

codecov bot commented May 10, 2022

Codecov Report

Merging #153 (de7b307) into main (6bb3943) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #153   +/-   ##
=======================================
  Coverage   82.39%   82.40%           
=======================================
  Files          52       52           
  Lines        4635     4637    +2     
=======================================
+ Hits         3819     3821    +2     
  Misses        816      816           
Impacted Files Coverage Δ
osa/paths.py 88.37% <100.00%> (+0.37%) ⬆️
osa/tests/test_paths.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6bb3943...de7b307. Read the comment docs.

@morcuended
Copy link
Member

I think this is ready @marialainez

@morcuended morcuended merged commit 384be71 into main May 10, 2022
@morcuended morcuended deleted the run_date branch May 10, 2022 14:36
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