GithubHelp home page GithubHelp logo

limaiem / externdata Goto Github PK

View Code? Open in Web Editor NEW

This project forked from modelica-3rdparty/externdata

0.0 2.0 0.0 24.06 MB

:page_facing_up: Modelica library for data I/O of CSV, INI, JSON, XML, MATLAB MAT and Excel XLS/XLSX files

License: BSD 2-Clause "Simplified" License

Modelica 0.48% Makefile 0.03% Shell 0.01% M4 0.01% C 98.64% C++ 0.83%

externdata's Introduction

ExternData

Free Modelica library for data I/O of CSV, INI, JSON, MATLAB MAT, Excel XLS/XLSX and XML files.

Build status

Build Status Build Status Build Status

Library description

ExternData is a utility library to access data stored in CSV, INI, JSON, MATLAB MAT, Excel XLS/XLSX or XML files. The aim of this library is to provide access from Modelica simulation tools to data sets for convenient model initialization and parametrization.

Main features

  • Read support of file formats
  • Pure C (and not C++) code for external functions and objects
  • Cross-platform (Windows and Linux)
  • Tested in Dymola and SimulationX, with dependency on the Modelica Standard Library v3.2.2.

All data I/O access is implemented using external Modelica functions. Furthermore, high level interfaces on these functions are provided via Modelica models.

Known issue with OpenModelica

The example models of the library are known to fail with OpenModelica. However, as a workaround the functions can be rewritten to make them working in OpenModelica by replacing their short class definitions and their appropriate function calls. For example, the short class definition ExternData.XMLFile.getReal

final function getReal = Functions.XML.getReal(xml=xml)
  "Get scalar Real value from XML file";

can be rewritten as function

function __OpenModelica_getReal "Get scalar Real value from XML file"
  extends Modelica.Icons.Function;
  input String fileName="" "File where external data is stored";
  input String varName "Key";
  output Real y "Real value";
  protected
    ExternData.Types.ExternXMLFile xml = ExternData.Types.ExternXMLFile(fileName) "External XML file object";
  algorithm
    y := ExternData.Functions.XML.Internal.getReal(xml=xml, varName=varName);
  annotation(Inline=true);
end __OpenModelica_getReal;

taking the file name as explicit argument for the external object.

License

ExternData is released under the terms of the Simplified BSD License.

Acknowledgement

ExternData is based on the following third-party C projects

  • bsxml-json - Borislav Sapundzhiev's fairly simple XML DOM and JSON implementation
  • expat - James Clark's Expat XML parser library
  • hdf5 - The HDF Group's data model, library and file format for storing and managing data
  • libxls - David Hoerl's C library for parsing Excel files
  • matio - Christopher Hulbert's C library for reading and writing MATLAB MAT-files
  • minIni - Thiadmer Riemersma's small and portable INI file library with read/write support
  • minizip - Gilles Vollant's Zip and UnZip library
  • uthash - Troy D. Hanson's C macros for hash tables and more
  • zlib - Jean-loup Gailly's and Mark Adler's massively spiffy yet delicately unobtrusive compression library
  • zstring - Fehmi Noyan ISI's string processing library for C

Development and contribution

You may report any issues with using the Issues button.

Contributions in shape of Pull Requests are always welcome.

externdata's People

Contributors

dietmarw avatar sjoelund avatar tbeu avatar thorade avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.