cornflow-client 1.3.6__tar.gz → 1.3.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cornflow_client-1.3.6/cornflow_client.egg-info → cornflow_client-1.3.7}/PKG-INFO +1 -1
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/core/application.py +2 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/core/experiment.py +0 -1
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_execution_files.py +39 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7/cornflow_client.egg-info}/PKG-INFO +1 -1
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/setup.py +1 -1
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/LICENSE +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/MANIFEST.in +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/README.rst +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/__init__.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/airflow/__init__.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/airflow/api.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/airflow/dag_utilities.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/constants.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/core/__init__.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/core/instance.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/core/instance_solution.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/core/read_tools.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/core/solution.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/core/tools.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/cornflow_client.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/data/__init__.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/data/empty_schema.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/data/pulp_json_schema.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/data/schema_validator.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/data/solver_config.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/data/vrp_solution_schema.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/databricks/__init__.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/databricks/api.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/raw_cornflow_client.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/schema/__init__.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/schema/dictSchema.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/schema/dict_functions.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/schema/manager.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/schema/tools.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/__init__.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/const.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/__init__.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/data_input_bad.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/data_schema.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/endpoints_access.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/endpoints_methods.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/gc_input.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/gc_output.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/graph_coloring_input.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/graph_coloring_output.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/hk_data_input.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/hk_data_schema.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/hk_solution_schema.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/instance-hackathon2.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/name_problem_schema.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/pulp_example_data.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/schema_with_fk.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/schema_without_fk.json +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/test_mps.mps +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/xl_with_access.xlsx +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/xl_with_fk.xlsx +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/xl_with_methods.xlsx +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/xl_without_fk.xlsx +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/integration/__init__.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/integration/test_airflow_integration.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/integration/test_cornflow_integration.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/integration/test_raw_cornflow_integration.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/__init__.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_abc.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_core.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_dag_utilities.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_instance_solution_methods.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_schema_from_excel.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_schema_manager.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_varnames.py +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client.egg-info/SOURCES.txt +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client.egg-info/dependency_links.txt +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client.egg-info/requires.txt +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client.egg-info/top_level.txt +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/requirements.txt +0 -0
- {cornflow_client-1.3.6 → cornflow_client-1.3.7}/setup.cfg +0 -0
|
@@ -23,6 +23,7 @@ from cornflow_client.constants import (
|
|
|
23
23
|
BadInstance,
|
|
24
24
|
EXECUTION_FILES_STATUS_NOT_GENERATED,
|
|
25
25
|
)
|
|
26
|
+
|
|
26
27
|
from .experiment import ExperimentCore
|
|
27
28
|
|
|
28
29
|
# Imports from internal modules
|
|
@@ -311,6 +312,7 @@ class ApplicationCore(ABC):
|
|
|
311
312
|
# Perform data checks only if a valid solution dict was obtained
|
|
312
313
|
# and the solver implements data_checks
|
|
313
314
|
# Checks for non-None and non-empty dict
|
|
315
|
+
solution_has_errors = False
|
|
314
316
|
if final_sol_dict:
|
|
315
317
|
solution_checks, solution_has_errors = self._check_solution_errors(algo)
|
|
316
318
|
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_execution_files.py
RENAMED
|
@@ -5,6 +5,8 @@ import unittest
|
|
|
5
5
|
import zipfile
|
|
6
6
|
from unittest.mock import Mock, patch
|
|
7
7
|
|
|
8
|
+
from openpyxl import load_workbook
|
|
9
|
+
|
|
8
10
|
from cornflow_client import (
|
|
9
11
|
ApplicationCore,
|
|
10
12
|
CornFlow,
|
|
@@ -267,6 +269,23 @@ class TestExperimentExecutionFiles(unittest.TestCase):
|
|
|
267
269
|
self.assertIn("checks.xlsx", names)
|
|
268
270
|
self.assertIn("solution_checks.xlsx", names)
|
|
269
271
|
|
|
272
|
+
def test_get_zip_file_includes_empty_tables_as_sheets(self):
|
|
273
|
+
"""
|
|
274
|
+
Validates that empty tables are kept as (empty) sheets in default exports.
|
|
275
|
+
"""
|
|
276
|
+
experiment = self._experiment(output_files={})
|
|
277
|
+
|
|
278
|
+
zip_file, status = experiment._get_zip_file({}, False, {}, False)
|
|
279
|
+
|
|
280
|
+
self.assertEqual(EXECUTION_FILES_STATUS_OK, status)
|
|
281
|
+
with zipfile.ZipFile(zip_file) as zf:
|
|
282
|
+
with zf.open("solution.xlsx") as solution_file:
|
|
283
|
+
workbook = load_workbook(io.BytesIO(solution_file.read()))
|
|
284
|
+
# The solution contains "an_empty_table": [], which must still get a sheet.
|
|
285
|
+
self.assertIn("an_empty_table", workbook.sheetnames)
|
|
286
|
+
self.assertEqual(1, workbook["an_empty_table"].max_row)
|
|
287
|
+
self.assertIsNone(workbook["an_empty_table"].cell(row=1, column=1).value)
|
|
288
|
+
|
|
270
289
|
def test_get_zip_file_includes_default_kpis_file(self):
|
|
271
290
|
"""
|
|
272
291
|
Validates that KPI data is included as a default Excel export.
|
|
@@ -531,5 +550,25 @@ class TestApplicationExecutionFiles(unittest.TestCase):
|
|
|
531
550
|
self.assertEqual(EXECUTION_FILES_STATUS_ERROR, result[4])
|
|
532
551
|
|
|
533
552
|
|
|
553
|
+
def test_validate_and_check_solution_handles_empty_solution(self):
|
|
554
|
+
"""
|
|
555
|
+
Validates that a schema-valid but empty solution does not raise and reports
|
|
556
|
+
no solution errors (regression: solution_has_errors was previously unbound).
|
|
557
|
+
"""
|
|
558
|
+
instance = ExecutionFilesInstance(self.instance_data)
|
|
559
|
+
# A solution whose schema validates but whose dict is falsy/empty.
|
|
560
|
+
solution = ExecutionFilesSolution({})
|
|
561
|
+
algo = ApplicationExecutionFilesSolver(instance, solution)
|
|
562
|
+
|
|
563
|
+
final_sol_dict, solution_checks, solution_has_errors, kpis = (
|
|
564
|
+
self.app._validate_and_check_solution(algo)
|
|
565
|
+
)
|
|
566
|
+
|
|
567
|
+
self.assertEqual({}, final_sol_dict)
|
|
568
|
+
self.assertFalse(solution_has_errors)
|
|
569
|
+
self.assertIsNone(solution_checks)
|
|
570
|
+
self.assertIsNone(kpis)
|
|
571
|
+
|
|
572
|
+
|
|
534
573
|
if __name__ == "__main__":
|
|
535
574
|
unittest.main()
|
|
@@ -12,7 +12,7 @@ extra_required = {"excel": ["openpyxl", "pandas"]}
|
|
|
12
12
|
|
|
13
13
|
setuptools.setup(
|
|
14
14
|
name="cornflow-client",
|
|
15
|
-
version="1.3.
|
|
15
|
+
version="1.3.7",
|
|
16
16
|
author="baobab soluciones",
|
|
17
17
|
author_email="sistemas@baobabsoluciones.es",
|
|
18
18
|
description="Client to connect to a cornflow server",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/data/vrp_solution_schema.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/data_input_bad.json
RENAMED
|
File without changes
|
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/endpoints_access.json
RENAMED
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/endpoints_methods.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/graph_coloring_input.json
RENAMED
|
File without changes
|
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/hk_data_input.json
RENAMED
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/hk_data_schema.json
RENAMED
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/hk_solution_schema.json
RENAMED
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/instance-hackathon2.json
RENAMED
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/name_problem_schema.json
RENAMED
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/pulp_example_data.json
RENAMED
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/schema_with_fk.json
RENAMED
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/schema_without_fk.json
RENAMED
|
File without changes
|
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/xl_with_access.xlsx
RENAMED
|
File without changes
|
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/xl_with_methods.xlsx
RENAMED
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/data/xl_without_fk.xlsx
RENAMED
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/integration/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_dag_utilities.py
RENAMED
|
File without changes
|
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_schema_from_excel.py
RENAMED
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client/tests/unit/test_schema_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cornflow_client-1.3.6 → cornflow_client-1.3.7}/cornflow_client.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|