From 56295912da055e00ff05ffcd59f4c4af7c74c9b5 Mon Sep 17 00:00:00 2001 From: Chris Mackey Date: Sat, 1 Jun 2024 14:31:36 -0700 Subject: [PATCH] fix(monthlychart): Update MonthlyChart.to_vis_set() with better method --- .github/workflows/ci.yaml | 8 ++++---- .releaserc.json | 8 +++++++- ladybug_display/extension/monthlychart.py | 9 +++++---- requirements.txt | 2 +- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4385f39..0dc5836 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -39,9 +39,9 @@ jobs: with: python-version: 3.7 - name: set up node # we need node for for semantic release - uses: actions/setup-node@v2.1.2 + uses: actions/setup-node@v4 with: - node-version: 14.2.0 + node-version: 22.2.0 - name: install python dependencies run: | python -m pip install --upgrade pip @@ -53,8 +53,8 @@ jobs: - name: run semantic release id: new_release run: | - nextRelease="`npx semantic-release@^17.0.0 --dryRun | grep -oP 'Published release \K.*? ' || true`" - npx semantic-release@^17.0.0 + nextRelease="`npx semantic-release@^23.1.1 --dryRun | grep -oP 'Published release \K.*? ' || true`" + npx semantic-release@^23.1.1 echo "::set-output name=tag::$nextRelease" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.releaserc.json b/.releaserc.json index 0459b65..8002347 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -2,7 +2,13 @@ "plugins": [ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", - "@semantic-release/github", + [ + "@semantic-release/github", + { + "successComment": false, + "failTitle": false + } + ], [ "@semantic-release/exec", { diff --git a/ladybug_display/extension/monthlychart.py b/ladybug_display/extension/monthlychart.py index 15f378d..169d58c 100644 --- a/ladybug_display/extension/monthlychart.py +++ b/ladybug_display/extension/monthlychart.py @@ -55,7 +55,7 @@ def monthly_chart_to_vis_set( set_id = 'Monthly_Chart_{}'.format(data_type.name.replace(' ', '_')) vis_set = VisualizationSet(set_id, ()) - # get values used througout the translation + # get values used throughout the translation txt_hgt = monthly_chart.legend_parameters.text_height font = monthly_chart.legend_parameters.font x_dim = monthly_chart.x_dim @@ -141,10 +141,11 @@ def monthly_chart_to_vis_set( # add the analysis geometry legend = monthly_chart.legend if monthly_chart.time_interval == 'MonthlyPerHour': + data_p_lines, line_colors = monthly_chart.data_polylines_with_colors data_lines = [Polyline3D.from_polyline2d(line, bp) - for line in monthly_chart.data_polylines] - month_count = len(data_lines) / len(monthly_chart.data_collections) - data_vals = [int(i / month_count) for i, pline in enumerate(data_lines)] + for line in data_p_lines] + data_colors = monthly_chart.colors + data_vals = [data_colors.index(col) for col in line_colors] vis_data = VisualizationData(data_vals, legend.legend_parameters) a_geo = AnalysisGeometry('Analysis_Data', data_lines, [vis_data]) else: diff --git a/requirements.txt b/requirements.txt index 91052d0..01e3aac 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -ladybug-core>=0.40.3 +ladybug-core>=0.42.29