Skip to content

Commit

Permalink
merge post_integration to validation
Browse files Browse the repository at this point in the history
  • Loading branch information
b4pm-devops committed Jan 28, 2025
2 parents c00749e + 4eabf17 commit 2979b21
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 3 deletions.
2 changes: 1 addition & 1 deletion platform_version_required.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v5.0.0
v5.0.1
50 changes: 50 additions & 0 deletions sostrades_optimization_plugins/tests/l0_test_plot_tools.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
'''
Copyright 2024 Capgemini
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
'''

import doctest
import unittest

import sostrades_optimization_plugins.tools.plot_tools.color_map as color_map
import sostrades_optimization_plugins.tools.plot_tools.color_palette as color_palette
import sostrades_optimization_plugins.tools.plot_tools.color_tools as color_tools


class TestColorTools(unittest.TestCase):
def test_doctests(self):
# Run doctests on the module
results = doctest.testmod(color_tools)
# Assert that all tests passed
self.assertEqual(results.failed, 0, f"{results.failed} doctests failed.")


class TestColorPalette(unittest.TestCase):
def test_doctests(self):
# Run doctests on the module
results = doctest.testmod(color_palette)
# Assert that all tests passed
self.assertEqual(results.failed, 0, f"{results.failed} doctests failed.")


class TestColorMap(unittest.TestCase):
def test_doctests(self):
# Run doctests on the module
results = doctest.testmod(color_map)
# Assert that all tests passed
self.assertEqual(results.failed, 0, f"{results.failed} doctests failed.")


if __name__ == '__main__':
unittest.main()
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ def visualize_palette(self, show: bool = True) -> go.Figure:
Example:
>>> cm = ColorPalette.from_preset(preset_name="witness")
>>> fig = cm.visualize_palette()
>>> fig = cm.visualize_palette(show=False)
"""
fig = go.Figure()

Expand Down Expand Up @@ -693,7 +693,7 @@ def visualize_groups(self, show: bool = True) -> go.Figure | None:
Example:
>>> cm = ColorPalette.from_preset(preset_name="witness")
>>> fig = cm.visualize_groups()
>>> fig = cm.visualize_groups(show=False)
"""
if not self.predefined_groups:
return None
Expand Down

0 comments on commit 2979b21

Please sign in to comment.