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

Added several plot methods and fixed a few minor bugs/warnings #262

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

tg359
Copy link
Contributor

@tg359 tg359 commented Nov 7, 2024

Issues addressed by this PR

Closes #261

See commit message.

Test files

See changes to pytest files for examples of use of the newly added methods. Bug fixes mainly regarded fixing methods which raised warnings about deprecation.

Changelog

Additional comments

@tg359 tg359 added severity:low Doesn't stop/slow current workflow size:S Measured in minutes type:bug Error or unexpected behaviour type:feature New capability or enhancement priority:low Resources should be targeted to other issues first labels Nov 7, 2024
@tg359 tg359 self-assigned this Nov 7, 2024
Copy link
Contributor

@Tom-Kingstone Tom-Kingstone left a comment

Choose a reason for hiding this comment

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

There are a couple of missing docstrings, and the utci comparison plot has a formatting issue. I have tested everything that has been changed, and these are the only issues I have come across.

Copy link
Contributor

@Tom-Kingstone Tom-Kingstone left a comment

Choose a reason for hiding this comment

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

Tested everything again (as well as new stuff added since last comment), and formatting of plots is all fixed now, though there are still some issues with unit tests, and a logic issue with the tilt orientation factor plot method.

Copy link
Contributor

Choose a reason for hiding this comment

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

Unit tests are failing due to removing create_legend() and heatmap_histogram().
(I see that heatmap_histogram was renamed to annual_heatmap_histogram with practicallly the same function, so that should be fine)

need some more thought on changes to create_legend, maybe keep the original method and just have it call create_legend_handles_labels and then create a legend with the output of that?
see:

_____________________________________________________ test_legend _____________________________________________________

    def test_legend():
        """_"""
>       assert isinstance(TEST_CATEGORICAL_UNBOUNDED.create_legend(), Legend)
E       AttributeError: 'Categorical' object has no attribute 'create_legend'

tests\test_categorical.py:129: AttributeError
_______________________________________________ test_heatmap_histogram ________________________________________________

    def test_heatmap_histogram() -> None:
        """_"""
>       assert isinstance(UTCI_DEFAULT_CATEGORIES.heatmap_histogram(TEST_TIMESERIES_DATA), Figure)
E       AttributeError: 'CategoricalComfort' object has no attribute 'heatmap_histogram'. Did you mean: 'annual_heatmap_histogram'?

tests\test_categorical.py:182: AttributeError

Comment on lines +437 to +438
# shuffle the iterations
np.random.shuffle(target_iterations)
Copy link
Contributor

Choose a reason for hiding this comment

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

why shuffle the iterations?
I would expect the order doesn't matter much, though when not running parallel it might be better if they were in order so that if one fails/is missed, it's easier to tell which one it was.

_tilts = np.linspace(0, 90, tilts)[:-1].tolist() + [89.999]
rrs: list[RadiationRose] = []
for ta in tqdm(_tilts):
sp = _dir / f"{epw_file.stem}_{ndir}_{ta:0.4f}.pickle"
Copy link
Contributor

Choose a reason for hiding this comment

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

This path also needs to include the analysis period description, as the analysis period is taken into account when creating the sky matrix.
Or some sort of representation of analysis_period.hoys, though I think ap start and end dates/times would be best.

As it currently is, if using the same tilts, directions and epw file, but different analysis periods (eg. comparing summer and winter), then one analysis period would be pickled, and then future analysis periods would only show the first used, ignoring the rest.

return ax


def tilt_orientation_factor(
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this replace the functionality of plot_tilt_orientation_factor? If so, remove that method as this is just an improvement upon that old version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:low Resources should be targeted to other issues first severity:low Doesn't stop/slow current workflow size:S Measured in minutes type:bug Error or unexpected behaviour type:feature New capability or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more plotting methods
2 participants