heatmap_cli 0.22.28__tar.gz → 0.22.30__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {heatmap_cli-0.22.28/src/heatmap_cli.egg-info → heatmap_cli-0.22.30}/PKG-INFO +1 -1
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/pyproject.toml +1 -1
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli/cli.py +8 -7
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30/src/heatmap_cli.egg-info}/PKG-INFO +1 -1
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_week_option.py +13 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/LICENSE.md +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/README.md +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/setup.cfg +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli/__init__.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli/__main__.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli/heatmap.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli.egg-info/SOURCES.txt +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli.egg-info/dependency_links.txt +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli.egg-info/entry_points.txt +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli.egg-info/requires.txt +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli.egg-info/top_level.txt +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_animate_by_week.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_annotate_flag.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_cbar_flag.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_cmap_option.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_cmax_option.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_cmin_option.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_debug_flag.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_demo_option.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_end_date_option.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_env_flag.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_heatmap_direct.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_heatmap_errors.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_heatmap_utils.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_help_flag.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_output_dir_option.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_purge_flag.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_quiet_flag.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_start_date_option.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_title_option.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_verbose_flag.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_version_flag.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_year_option.py +0 -0
- {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_yes_flag.py +0 -0
|
@@ -25,7 +25,7 @@ classifiers = [
|
|
|
25
25
|
"Programming Language :: Python",
|
|
26
26
|
"Topic :: Scientific/Engineering :: Visualization",
|
|
27
27
|
]
|
|
28
|
-
version = "0.22.
|
|
28
|
+
version = "0.22.30"
|
|
29
29
|
keywords = ["heatmap", "cli", "visualization", "calendar", "data-viz"]
|
|
30
30
|
dependencies = [
|
|
31
31
|
"matplotlib",
|
|
@@ -127,12 +127,10 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
127
127
|
"--week",
|
|
128
128
|
dest="week",
|
|
129
129
|
type=int,
|
|
130
|
-
default=
|
|
131
|
-
.isocalendar()
|
|
132
|
-
.week,
|
|
130
|
+
default=None,
|
|
133
131
|
help=(
|
|
134
132
|
"filter until week of the year from the CSV file "
|
|
135
|
-
"(default:
|
|
133
|
+
"(default: current week)"
|
|
136
134
|
),
|
|
137
135
|
metavar="WEEK",
|
|
138
136
|
)
|
|
@@ -413,10 +411,13 @@ def _process_args(
|
|
|
413
411
|
if not parsed_args.demo and parsed_args.input_filename is None:
|
|
414
412
|
parser.error("the following arguments are required: CSV_FILENAME")
|
|
415
413
|
|
|
416
|
-
# Handle
|
|
414
|
+
# Handle defaults for year and week
|
|
415
|
+
if parsed_args.year is None or parsed_args.week is None:
|
|
416
|
+
now = datetime.datetime.now(tz=datetime.timezone.utc)
|
|
417
417
|
if parsed_args.year is None:
|
|
418
|
-
|
|
419
|
-
|
|
418
|
+
parsed_args.year = [now.year]
|
|
419
|
+
if parsed_args.week is None:
|
|
420
|
+
parsed_args.week = now.isocalendar().week
|
|
420
421
|
|
|
421
422
|
# Handle default for cmap
|
|
422
423
|
if parsed_args.cmap is None:
|
|
@@ -13,9 +13,22 @@
|
|
|
13
13
|
# You should have received a copy of the GNU Affero General Public License
|
|
14
14
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
15
15
|
|
|
16
|
+
import datetime
|
|
17
|
+
|
|
16
18
|
import pytest
|
|
17
19
|
|
|
18
20
|
|
|
21
|
+
def test_default_week_is_current_week(cli_runner, csv_file):
|
|
22
|
+
"""Test that --week defaults to the current ISO week when not provided."""
|
|
23
|
+
csv = csv_file("sample.csv")
|
|
24
|
+
expected_week = (
|
|
25
|
+
datetime.datetime.now(tz=datetime.timezone.utc).isocalendar().week
|
|
26
|
+
)
|
|
27
|
+
ret = cli_runner(csv, "-y", "2024", "-d")
|
|
28
|
+
|
|
29
|
+
assert f"week={expected_week}" in ret.stderr
|
|
30
|
+
|
|
31
|
+
|
|
19
32
|
@pytest.mark.parametrize("option", ["-w", "--week"])
|
|
20
33
|
def test_debug_logs(cli_runner, csv_file, option):
|
|
21
34
|
csv = csv_file("sample.csv")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|