Commit 5b72fbce authored by Jorn Baayen's avatar Jorn Baayen

Log versions of pymola and casadi.

parent 412764f9
from pymola.backends.casadi.api import transfer_model
import pymola
import pymola.backends.casadi.api
import casadi as ca
import numpy as np
import itertools
......@@ -31,6 +32,9 @@ class ModelicaMixin(OptimizationProblem):
# Check arguments
assert('model_folder' in kwargs)
# Log pymola version
logger.debug("Using pymola {}.".format(pymola.__version__))
# Transfer model from the Modelica .mo file to CasADi using pymola
if 'model_name' in kwargs:
model_name = kwargs['model_name']
......@@ -40,7 +44,7 @@ class ModelicaMixin(OptimizationProblem):
else:
model_name = self.__class__.__name__
self.__pymola_model = transfer_model(kwargs['model_folder'], model_name, self.compiler_options())
self.__pymola_model = pymola.backends.casadi.api.transfer_model(kwargs['model_folder'], model_name, self.compiler_options())
# Extract the CasADi MX variables used in the model
self.__mx = {}
......
......@@ -5,6 +5,7 @@ Author: Jorn Baayen
Date : March 16, 2016
"""
import casadi
import logging
import sys
import os
......@@ -66,6 +67,8 @@ def run_optimization_problem(optimization_problem_class, base_folder='..', log_l
# Log version info
logger.info(
"Using RTC-Tools {}, released as open source software under the GNU General Public License.".format(__version__))
logger.debug(
"Using CasADi {}.".format(casadi.__version__))
# Check for some common mistakes in inheritance order
suggested_order = OrderedSet(['HomotopyMixin', 'GoalProgrammingMixin', 'PIMixin', 'CSVMixin', 'ModelicaMixin', 'CollocatedIntegratedOptimizationProblem', 'OptimizationProblem'])
......@@ -143,6 +146,8 @@ def run_simulation_problem(simulation_problem_class, base_folder='..', log_level
logger.info(
"Using RTC-Tools {}, released as open source software under the GNU General Public License.".format(__version__))
logger.debug(
"Using CasADi {}.".format(casadi.__version__))
# Run
prob = simulation_problem_class(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment