def check_model_with_cocos(cls, model_as_string):
        if pynestml_available:
            Logger.init_logger(LoggingLevel.NO)

            model = ModelParser.parse_model(model=model_as_string, from_string=True)
            return str(Logger.get_json_format())
        else:
            print('PyNestML not available, no checks performed!')
            return str({})
    def check_model_syntax(cls, model_as_string):
        if pynestml_available:
            Logger.init_logger(LoggingLevel.NO)
            input_file = InputStream(model_as_string)
            lexer = PyNestMLLexer(input_file)
            set_up_lexer_error_reporting(lexer)
            # create a token stream
            stream = CommonTokenStream(lexer)
            stream.fill()
            # parse the file
            parser = PyNestMLParser(stream)
            set_up_parser_error_reporting(parser)
            parser.nestMLCompilationUnit()

            return str(Logger.get_json_format())
        else:
            print('PyNestML not available, no checks performed!')
            return str({})
Exemple #3
0
def store_log_to_file():
    with open(
            str(
                os.path.join(FrontendConfiguration.get_target_path(), "..",
                             "report", "log")) + ".txt", "w+") as f:
        f.write(str(Logger.get_json_format()))
Exemple #4
0
def store_log_to_file():
    with open(
            str(
                os.path.join(FrontendConfiguration.get_target_path(), '..',
                             'report', 'log')) + '.txt', 'w+') as f:
        f.write(str(Logger.get_json_format()))