• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Ouranosinc / miranda / 2110305507

pending completion
2110305507

Pull #24

github

GitHub
Merge e12376f7a into bf78f91b7
Pull Request #24: Add CMIP file structure, use pyessv controlled vocabularies, and major refactoring

230 of 1043 new or added lines in 35 files covered. (22.05%)

13 existing lines in 4 files now uncovered.

724 of 3187 relevant lines covered (22.72%)

0.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

57.89
/miranda/archive/selection.py
1
import logging
3✔
2
from datetime import date
3✔
3
from datetime import datetime as dt
3✔
4
from logging import config
3✔
5
from pathlib import Path
3✔
6
from typing import List, Union
3✔
7

8
from miranda.scripting import LOGGING_CONFIG
3✔
9
from miranda.utils import creation_date, find_filepaths
3✔
10

11
__all__ = ["select_by_date_modified"]
3✔
12

13
logging.config.dictConfig(LOGGING_CONFIG)
3✔
14

15

16
def select_by_date_modified(
3✔
17
    source: Union[Path, str],
18
    year: int,
19
    month: int,
20
    day: int,
21
    pattern: str = None,
22
    datetime: date = None,
23
) -> List:
24

25
    date_selected = date(year, month, day) or datetime
×
26

27
    files = find_filepaths(source, file_suffixes=pattern)
×
28

29
    selected_files = list()
×
30
    for file in files:
×
31
        if creation_date(file) == date_selected:
×
NEW
32
            logging.info(f"{dt.now().strftime('%Y-%m-%d %X')}: Selecting {file}")
×
UNCOV
33
            selected_files.append(file)
×
34

35
    return selected_files
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2024 Coveralls, Inc