GithubHelp home page GithubHelp logo

Comments (1)

MartinOtter avatar MartinOtter commented on August 22, 2024

@instantiateModel fails when the Model contains Unitful quantities, as in the pendulum example in the README.

The pendulum example in the README file is available as Modia/examples/Pendulum.jl. When executing it on my (Windows) machine, it translates and simulates correctly.

The docu in Unitful states:

By default, exponents on units or dimensions are indicated using Unicode superscripts on macOS and without superscripts on other operating systems. You can set the environment variable UNITFUL_FANCY_EXPONENTS to either true or false to force using or not using the exponents.

So, you are probably working on macOS. It feels a bit dangerous that a global environment variable is set inside Modia. It would be better to extend Modia, so that units with exponents are also correctly handled on macOS without setting this environment variable. When inspecting https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts it seems quite complicated to support this, because there are Unicode superscripts for a large set of characters. We also have no access to macOS, and cannot test such a bug fix.

The simplest solution is probably to follow your suggestion, so set ENV["UNITFUL_FANCY_EXPONENTS"]=false on macOS when entering @instantiateModel, and additionally print a warning message, if ENV["UNITFUL_FANCY_EXPONENTS"] was not set or has a value of true on macOS.

from modia.jl.

Related Issues (20)

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.