diff --git a/src/greenbutton_objects/atom/href_tree.py b/src/greenbutton_objects/atom/href_tree.py index 571dea1..ff6f853 100644 --- a/src/greenbutton_objects/atom/href_tree.py +++ b/src/greenbutton_objects/atom/href_tree.py @@ -79,7 +79,8 @@ def entry_content_type(entry: EntryType) -> type: return self - def get_entry_title(self, entry: EntryType) -> str: + @staticmethod + def get_entry_title(entry: EntryType) -> str: if entry.title: title_parts = [] for text in entry.title: diff --git a/src/greenbutton_objects/orig_objects/objects.py b/src/greenbutton_objects/orig_objects/objects.py index e4e105b..dc71015 100644 --- a/src/greenbutton_objects/orig_objects/objects.py +++ b/src/greenbutton_objects/orig_objects/objects.py @@ -70,8 +70,7 @@ class MeterReading: class UsagePoint: """ Logical point on a network at which consumption or production is either - physically measured (e.g., metered) or estimated (e.g., unmetered street - lights). + physically measured (e.g., metered) or estimated (e.g., unmetered streetlights). :ivar title: The title of the usage point. :ivar uri: The URI that identifies this usage point in the atom feed diff --git a/src/greenbutton_objects/parse.py b/src/greenbutton_objects/parse.py index 90cc0bd..06da6ce 100755 --- a/src/greenbutton_objects/parse.py +++ b/src/greenbutton_objects/parse.py @@ -132,8 +132,4 @@ def compute_multiplier(reading_type: ReadingType) -> float: missing_val=UnitMultiplierKindValue.VALUE_0, ) - if reading_type.power_of_ten_multiplier: - multiplier: float = 10.0**reading_power_ten.value - else: - multiplier = 1.0 - return multiplier + return 10.0**reading_power_ten.value diff --git a/tests/test_parse.py b/tests/test_parse.py index 8ba0128..b48c6fa 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -10,7 +10,6 @@ import os import pathlib from pathlib import Path -from typing import Iterable import pytest from greenbutton_objects import parse @@ -23,7 +22,7 @@ def _save_representation(test_xml_path: Path, test_output_path: Path) -> None: Parse an XML feed, generate a representation, and save it to a text file. """ - parsed_feed = parse.parse_feed(test_xml_path) + parsed_feed = parse.parse_feed(str(test_xml_path)) representation = parse.parse_feed_representation(parsed_feed) with open(test_output_path, "w") as f: f.write(representation) @@ -95,20 +94,10 @@ def test_parse_natural_gas_feed(data_file_name): check_file(Path(data_file_name)) -@pytest.fixture() -def electricity_feeds(data_dir) -> Iterable[Path]: - return (data_dir / "electricity").iterdir() - - -@pytest.fixture() -def natural_gas_feeds(data_dir): - yield from (data_dir / "natural_gas").iterdir() - - @pytest.mark.parametrize("energy_source", ["electricity", "natural_gas"]) def test_quick(data_dir, energy_source): """ - Very quick test that runs only one of of the files from each source + Very quick test that runs only one of the files from each source """ files = (data_dir / energy_source).iterdir() @@ -126,7 +115,7 @@ def test_quick(data_dir, energy_source): ) def test_abridged(data_dir, energy_source): """ - Very quick test that runs only one of of the files from each source + Very quick test that runs only one of the files from each source """ files = (data_dir / energy_source).iterdir()