Skip to content

Commit

Permalink
timezone in figure title respects time_format (#11)
Browse files Browse the repository at this point in the history
Previously the timezone in the title always showed UTC.

Now it displays either Utc or Local depending on what
time_format is set to.

This is also replicated to the filename.

version bump from 0.2.0 to 0.2.1
  • Loading branch information
tomellm authored May 20, 2024
1 parent 47eae26 commit e3df37e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ShadowFinder"
version = "0.2.0"
version = "0.2.1"
description = "Find possible locations of shadows."
authors = ["Bellingcat"]
license = "MIT License"
Expand Down Expand Up @@ -39,4 +39,4 @@ black = "^24.2.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
build-backend = "poetry.core.masonry.api"
4 changes: 2 additions & 2 deletions shadowfinder/shadowfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def quick_find(self):
self.find_shadows()
fig = self.plot_shadows()
fig.savefig(
f"shadow_finder_{self.date_time.strftime('%Y%m%d-%H%M%S-%Z')}_{self.object_height}_{self.shadow_length}.png"
f"shadow_finder_{self.date_time.strftime('%Y%m%d-%H%M%S')}-{self.time_format.title()}_{self.object_height}_{self.shadow_length}.png"
)

def generate_timezone_grid(self):
Expand Down Expand Up @@ -181,7 +181,7 @@ def plot_shadows(

# plt.colorbar(label='Relative Shadow Length Difference')
plt.title(
f"Possible Locations at {self.date_time.strftime('%Y-%m-%d %H:%M:%S %Z')}\n(object height: {self.object_height}, shadow length: {self.shadow_length})"
f"Possible Locations at {self.date_time.strftime('%Y-%m-%d %H:%M:%S')} {self.time_format.title()}\n(object height: {self.object_height}, shadow length: {self.shadow_length})"
)
self.fig = fig
return fig

0 comments on commit e3df37e

Please sign in to comment.