Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Daveiano/weewx-wdc
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.2.1
Choose a base ref
...
head repository: Daveiano/weewx-wdc
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.x
Choose a head ref

Commits on Jun 1, 2022

  1. Copy the full SHA
    6836b19 View commit details
  2. Updated changelog.

    Daveiano committed Jun 1, 2022
    Copy the full SHA
    11ddbc4 View commit details

Commits on Jun 4, 2022

  1. Copy the full SHA
    6322bee View commit details
  2. Updated package.json

    Daveiano committed Jun 4, 2022
    Copy the full SHA
    98c5dbd View commit details
  3. Added .gitattributes.

    Daveiano committed Jun 4, 2022
    Copy the full SHA
    480f1a9 View commit details
  4. Copy the full SHA
    8b43116 View commit details

Commits on Jun 7, 2022

  1. Copy the full SHA
    f65f852 View commit details
  2. Merge pull request #16 from Daveiano/13-outsource-carbon-datatable-im…

    …plementation
    
    13 outsource carbon datatable implementation
    Daveiano authored Jun 7, 2022
    Copy the full SHA
    a61741c View commit details

Commits on Jun 8, 2022

  1. Copy the full SHA
    f05d5d5 View commit details

Commits on Jun 9, 2022

  1. Copy the full SHA
    dc62959 View commit details

Commits on Jun 10, 2022

  1. Copy the full SHA
    ec79195 View commit details

Commits on Jun 11, 2022

  1. Copy the full SHA
    2b51af9 View commit details
  2. Merge pull request #18 from Daveiano/6-find-a-way-to-zoommake-diagram…

    …s-bigger
    
    6 find a way to zoommake diagrams bigger
    Daveiano authored Jun 11, 2022
    Copy the full SHA
    2784c21 View commit details

Commits on Jun 13, 2022

  1. Copy the full SHA
    386c09a View commit details
  2. Updated readme.

    Daveiano committed Jun 13, 2022
    Copy the full SHA
    e0e2cbf View commit details

Commits on Jun 15, 2022

  1. Copy the full SHA
    2086c28 View commit details
  2. Copy the full SHA
    c59ed95 View commit details

Commits on Jun 16, 2022

  1. Copy the full SHA
    bcf301d View commit details
  2. Copy the full SHA
    2f29e4e View commit details

Commits on Jun 17, 2022

  1. Merge pull request #20 from Daveiano/15-about-page-with-user-provided…

    …-content
    
    Added static page SLE to render links. Added about.htm.tmpl. [GH-15]
    Daveiano authored Jun 17, 2022
    Copy the full SHA
    b51abcd View commit details
  2. Copy the full SHA
    d90f28b View commit details

Commits on Jun 28, 2022

  1. Copy the full SHA
    8076494 View commit details
  2. Updated readme.

    Daveiano committed Jun 28, 2022
    Copy the full SHA
    d959ead View commit details

Commits on Jun 29, 2022

  1. Copy the full SHA
    8769dc8 View commit details
  2. chore: Added shunit2 test for bundling, installing in docker and runn…

    …ing wee_reports. Added github test workflow.
    Daveiano committed Jun 29, 2022
    Copy the full SHA
    d411db2 View commit details
  3. Test test fail.

    Daveiano committed Jun 29, 2022
    Copy the full SHA
    0ababdc View commit details
  4. Fixed failing test.

    Daveiano committed Jun 29, 2022
    Copy the full SHA
    7c05060 View commit details
  5. Copy the full SHA
    e37580f View commit details

Commits on Jun 30, 2022

  1. Bump version to 1.3.0.

    Daveiano committed Jun 30, 2022
    Copy the full SHA
    9ab9e8c View commit details
  2. Updated changelog.

    Daveiano committed Jun 30, 2022
    Copy the full SHA
    28c8ee2 View commit details

Commits on Jul 1, 2022

  1. Updated readme.

    Daveiano committed Jul 1, 2022
    Copy the full SHA
    a5c6c40 View commit details

Commits on Jul 7, 2022

  1. Updated .gitignore.

    Daveiano committed Jul 7, 2022
    Copy the full SHA
    70621b4 View commit details
  2. Typo fixes for de.

    Daveiano committed Jul 7, 2022
    Copy the full SHA
    08a0b0f View commit details
  3. Fixes GH-24

    Daveiano committed Jul 7, 2022
    Copy the full SHA
    9543488 View commit details

Commits on Jul 8, 2022

  1. Fixes GH-26

    Daveiano committed Jul 8, 2022
    Copy the full SHA
    c220034 View commit details
  2. Bump version to 1.3.1.

    Daveiano committed Jul 8, 2022
    Copy the full SHA
    685b070 View commit details

Commits on Jul 13, 2022

  1. Copy the full SHA
    314210d View commit details

Commits on Jul 19, 2022

  1. Fixes [GH-31]

    Daveiano committed Jul 19, 2022
    Copy the full SHA
    041ac29 View commit details

Commits on Jul 21, 2022

  1. Fixes [GH-30]

    Daveiano committed Jul 21, 2022
    Copy the full SHA
    c1a19d1 View commit details
  2. Bump version to 1.3.3.

    Daveiano committed Jul 21, 2022
    Copy the full SHA
    1e2e5ba View commit details
Showing with 1,938 additions and 1,364 deletions.
  1. +3 −0 .gitattributes
  2. +1 −1 .github/workflows/release.yml
  3. +36 −0 .github/workflows/test.yml
  4. +6 −1 .gitignore
  5. +7 −2 .vscode/settings.json
  6. +5 −8 bin/user/archive_util.py
  7. +65 −43 bin/user/diagram_util.py
  8. +61 −17 bin/user/forecast_util.py
  9. +100 −77 bin/user/general_util.py
  10. +178 −118 bin/user/stats_util.py
  11. +72 −37 bin/user/table_util.py
  12. +32 −1 changelog.md
  13. +102 −92 install.py
  14. +4 −2 package.json
  15. +48 −7 readme.md
  16. +409 −0 skins/weewx-wdc/about.html.tmpl
  17. +5 −5 skins/weewx-wdc/includes/climatological-days.inc
  18. +1 −1 skins/weewx-wdc/includes/combined-diagram-tile.inc
  19. +3 −2 skins/weewx-wdc/includes/data-table-tile.inc
  20. +1 −1 skins/weewx-wdc/includes/diagram-tile.inc
  21. +50 −0 skins/weewx-wdc/includes/icons/forecast/thunderstorm--scattered.svg
  22. +33 −0 skins/weewx-wdc/includes/icons/forecast/thunderstorm.svg
  23. +1 −1 skins/weewx-wdc/includes/stat-tile.inc
  24. +30 −1 skins/weewx-wdc/includes/ui-shell.inc
  25. +2 −0 skins/weewx-wdc/index.html.tmpl
  26. +6 −5 skins/weewx-wdc/lang/de.conf
  27. +1 −0 skins/weewx-wdc/lang/en.conf
  28. +2 −0 skins/weewx-wdc/month-%Y-%m.html.tmpl
  29. +2 −0 skins/weewx-wdc/month.html.tmpl
  30. +14 −2 skins/weewx-wdc/skin.conf
  31. +25 −0 skins/weewx-wdc/src/js/assets/maximize.tsx
  32. +0 −54 skins/weewx-wdc/src/js/data-table/components/pagination.tsx
  33. +0 −7 skins/weewx-wdc/src/js/data-table/hooks/index.ts
  34. +0 −20 skins/weewx-wdc/src/js/data-table/hooks/useCollator.ts
  35. +0 −27 skins/weewx-wdc/src/js/data-table/hooks/useFilteredRows.ts
  36. +0 −33 skins/weewx-wdc/src/js/data-table/hooks/usePageInfo.ts
  37. +0 −33 skins/weewx-wdc/src/js/data-table/hooks/useRowSelection.ts
  38. +0 −83 skins/weewx-wdc/src/js/data-table/hooks/useSortInfo.ts
  39. +0 −44 skins/weewx-wdc/src/js/data-table/hooks/useSortedRows.ts
  40. +0 −13 skins/weewx-wdc/src/js/data-table/hooks/useUniqueId.ts
  41. +0 −16 skins/weewx-wdc/src/js/data-table/misc/doesRowMatchSearchString.ts
  42. +0 −84 skins/weewx-wdc/src/js/data-table/misc/enums.ts
  43. +0 −2 skins/weewx-wdc/src/js/data-table/misc/index.ts
  44. +0 −344 skins/weewx-wdc/src/js/data-table/table-base.tsx
  45. +66 −56 skins/weewx-wdc/src/js/diagrams/bar.tsx
  46. +57 −44 skins/weewx-wdc/src/js/diagrams/calendar.tsx
  47. +73 −62 skins/weewx-wdc/src/js/diagrams/line.tsx
  48. +17 −8 skins/weewx-wdc/src/js/index.tsx
  49. +102 −5 skins/weewx-wdc/src/scss/index.scss
  50. +3 −0 skins/weewx-wdc/statistics.html.tmpl
  51. +2 −0 skins/weewx-wdc/week.html.tmpl
  52. +2 −0 skins/weewx-wdc/year-%Y.html.tmpl
  53. +2 −0 skins/weewx-wdc/year.html.tmpl
  54. +16 −0 test/run_tests.sh
  55. +60 −0 test/test_install_report/Dockerfile
  56. +65 −0 test/test_install_report/install_report_test.sh
  57. +7 −0 test/test_install_report/src/install-input.txt
  58. +118 −0 test/test_install_report/src/skin.conf
  59. +13 −0 test/test_install_report/src/start.sh
  60. BIN test/test_install_report/src/weewx-db_06_23_2022_08_00.tar
  61. +0 −5 test_install.sh
  62. +30 −0 yarn.lock
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
skins/weewx-wdc/includes/*.inc linguist-language=Python
skins/weewx-wdc/includes/icons/*.inc linguist-documentation
skins/weewx-wdc/includes/pictograms/*.inc linguist-documentation
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ jobs:
with:
type: "zip"
filename: "weewx-wdc-${{github.ref_name}}.zip"
exclusions: "*.git* /*node_modules/* /*.vscode/* /*.parcel-cache/* /*.yarn/* .eslintrc.json .prettierignore .prettierrc.json package.json tsconfig.json yarn.lock .yarnrc test_install.sh /*skins/weewx-wdc/src/*"
exclusions: "*.git* /*node_modules/* /*.vscode/* /*.parcel-cache/* /*.yarn/* .eslintrc.json .prettierignore .prettierrc.json package.json tsconfig.json yarn.lock .yarnrc /*test/* /*skins/weewx-wdc/src/*"

- uses: ncipollo/release-action@v1
with:
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Tests

on:
push:
branches: [1.x, 2.x]
pull_request:
branches: [1.x, 2.x]

jobs:
shunit2-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: 🔨 Setup node
uses: actions/setup-node@v2
with:
node-version: "14"

- name: 🔨 install yarn and dependecies
run: |
npm install -g yarn
yarn install
- name: Run shunit2 tests
run: ./test/run_tests.sh

- uses: actions/upload-artifact@v3
if: always()
with:
name: test_install_report_artifacts
path: test/test_install_report/artifacts/

- name: 🔨 uninstall Yarn
if: always()
run: npm uninstall -g yarn
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -13,4 +13,9 @@ node_modules
# Project specific.
skins/weewx-wdc/dist
skins/weewx-wdc/service-worker.js
skins/weewx-wdc/service-worker.js.map
skins/weewx-wdc/service-worker.js.map

# Tests
test/test_install_report/src/weewx-wdc.zip
test/shunit2
test/*/artifacts
9 changes: 7 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -5,9 +5,14 @@
"files.associations": {
"*.inc": "html",
"*.html.tmpl": "html",
"*.svg": "html"
"*.svg": "html",
"*.py": "python"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.alwaysShowStatus": true,
"eslint.packageManager": "yarn"
"eslint.packageManager": "yarn",
"python.formatting.provider": "black",
"[python]": {
"editor.defaultFormatter": "ms-python.python"
}
}
13 changes: 5 additions & 8 deletions bin/user/archive_util.py
Original file line number Diff line number Diff line change
@@ -35,9 +35,9 @@ def month_string_format(self, month):
Returns:
str: Formatted month string.
"""
date_time_obj = datetime.strptime(month, '%Y-%m')
date_time_obj = datetime.strptime(month, "%Y-%m")

return date_time_obj.strftime('%B')
return date_time_obj.strftime("%B")

def fake_get_report_years(self, first, last):
"""
@@ -49,14 +49,11 @@ def fake_get_report_years(self, first, last):
Returns:
list: [2022, 2021].
"""
first_year = int(first.format("%Y"))
last_year = int(last.format("%Y"))
first_year = int(first)
last_year = int(last)

if first_year == last_year:
return [last_year]

if first_year + 1 == last_year:
return [first_year, last_year]

else:
return list(range(first_year, last_year))
return list(range(first_year, last_year + 1))
108 changes: 65 additions & 43 deletions bin/user/diagram_util.py
Original file line number Diff line number Diff line change
@@ -19,18 +19,17 @@ def get_diagram_type(self, observation):
Returns:
str: A diagram type string
"""
if (observation in GeneralUtil.temp_obs or
'temp' in observation.lower()):
return 'temp'
if observation in GeneralUtil.temp_obs or "temp" in observation.lower():
return "temp"

if 'humidity' in observation.lower():
return 'humidity'
if "humidity" in observation.lower():
return "humidity"

if observation == 'windSpeed' or observation == 'windGust':
return 'wind'
if observation == "windSpeed" or observation == "windGust":
return "wind"

if observation == 'barometer' or observation == 'pressure':
return 'pressure'
if observation == "barometer" or observation == "pressure":
return "pressure"

return observation

@@ -44,10 +43,10 @@ def get_diagram(self, observation):
Returns:
str: A diagram string
"""
if observation == 'rain' or observation == 'ET':
return 'bar'
if observation == "rain" or observation == "ET":
return "bar"

return 'line'
return "line"

def get_aggregate_type(self, observation):
"""
@@ -60,15 +59,17 @@ def get_aggregate_type(self, observation):
Returns:
string: aggregate_type
"""
if observation == 'ET' or observation == 'rain':
return 'sum'
if observation == "ET" or observation == "rain":
return "sum"

if (observation == 'UV' or
observation == 'windGust' or
observation == 'rainRate'):
return 'max'
if (
observation == "UV"
or observation == "windGust"
or observation == "rainRate"
):
return "max"

return 'avg'
return "avg"

def get_aggregate_interval(self, observation, precision, *args, **kwargs):
"""
@@ -82,58 +83,79 @@ def get_aggregate_interval(self, observation, precision, *args, **kwargs):
Returns:
int: aggregate_interval
"""
alltime_start = kwargs.get('alltime_start', None)
alltime_end = kwargs.get('alltime_end', None)
alltime_start = kwargs.get("alltime_start", None)
alltime_end = kwargs.get("alltime_end", None)

if precision == 'day':
if observation == 'ET' or observation == 'rain':
if precision == "day":
if observation == "ET" or observation == "rain":
return 7200 # 2 hours

return 1800 # 30 minutes

if precision == 'week':
if observation == 'ET' or observation == 'rain':
if precision == "week":
if observation == "ET" or observation == "rain":
return 3600 * 24 # 1 day

return 900 * 8 # 2 hours

if precision == 'month':
if observation == 'ET' or observation == 'rain':
if precision == "month":
if observation == "ET" or observation == "rain":
return 3600 * 48 # 2 days

return 900 * 24 # 6 hours

if precision == 'year':
if observation == 'ET' or observation == 'rain':
if precision == "year":
if observation == "ET" or observation == "rain":
return 3600 * 432 # 8 days

return 3600 * 48 # 2 days

if precision == 'alltime':
if (alltime_start is not None and
alltime_end is not None):
if precision == "alltime":
if alltime_start is not None and alltime_end is not None:

d1 = datetime.strptime(alltime_start, '%d.%m.%Y')
d2 = datetime.strptime(alltime_end, '%d.%m.%Y')
d1 = datetime.strptime(alltime_start, "%d.%m.%Y")
d2 = datetime.strptime(alltime_end, "%d.%m.%Y")
delta = d2 - d1

if delta.days == 0:
# Edge case: code from year.
if observation == 'ET' or observation == 'rain':
if observation == "ET" or observation == "rain":
return 3600 * 432 # 8 days

return 3600 * 48 # 2 days

if observation == 'ET' or observation == 'rain':
if observation == "ET" or observation == "rain":
return 3600 * (delta.days / 20) * 24 # Max of 20 bars

return 3600 * (delta.days / 100) * 24 # Max of 100 points
else:
if observation == 'ET' or observation == 'rain':
if observation == "ET" or observation == "rain":
return 3600 * 432 # 8 days

return 3600 * 96 # 4 days

def get_diagram_boundary(self, precision):
"""
boundary for observations series for diagrams.
Args:
precision (string): Day, week, month, year, alltime
Returns:
string: None | 'midnight'
"""
if precision == "day":
return None

if precision == "week":
return None

if precision == "month":
return None

if precision == "year" or precision == "alltime":
return "midnight"

def get_rounding(self, observation):
"""
Rounding settings for observations.
@@ -144,10 +166,10 @@ def get_rounding(self, observation):
Returns:
int: A rounding
"""
if observation == 'UV' or observation == 'cloudbase':
if observation == "UV" or observation == "cloudbase":
return 0

if observation == 'ET':
if observation == "ET" or observation == "rain":
return 2

return 1
@@ -166,13 +188,13 @@ def get_hour_delta(self, precision):

hour_delta = 24

if precision == 'week':
if precision == "week":
hour_delta = 24 * 7

if precision == 'month':
if precision == "month":
hour_delta = 24 * 30 # monthrange(now.year, now.month)[1]

if precision == 'year':
if precision == "year":
days = 366 if isleap(now.year) else 365
hour_delta = 24 * days

@@ -190,7 +212,7 @@ def get_week_delta(self, precision):
"""
week_delta = 0

if precision == 'alltime':
if precision == "alltime":
week_delta = 1000 # TODO: This will stop to work after 19 years.

return week_delta
Loading