Giter Site home page Giter Site logo

plugin-python's Introduction

.github/workflows/ant.yml

Funz plugin: Python 3

This plugin is dedicated to launch Python 3 calculations from Funz. It supports the following syntax and features:

  • Input

    • file type supported: '*.py', any other format for resources
    • parameter syntax:
      • variable syntax: ?[...]
      • formula syntax: ${...}
      • comment char: #
    • example input file:
    import math as m
    def branin(x1,x2):
        x1 = x1*15-5
        x2 = x2*15
    
        return (x2 - 5/(4*m.pi^2)*(x1^2) + 5/m.pi*x1 -6 )^2 + 10*(1-1/(8*m.pi))*m.cos(x1) +10
    print( "z={0}".format( branin( ?[x1~[1,2]], ${?[x2] +1.23} | #.###)))
    
    • will identify input:
      • x1, expected to vary inside [1,2]
      • x2, expected to vary inside [0,1] (by default)
    • replace ${?[x2] + 1.23 | #.###} expression by its evaluation
  • Output

    • file type supported: 'out.txt'
    • read any named value printed with =, like print("z={0}".format(1.234))
    • example output file:
    import math as m
    def branin(x1,x2):
        x1 = x1*15-5
        x2 = x2*15
    
        return (x2 - 5/(4*m.pi**2)*(x1**2) + 5/m.pi*x1 -6 )**2 + 10*(1-1/(8*m.pi))*m.cos(x1) +10
    
    print( "z={0}".format( branin( 0.5, 0.132) ) )
    
    • will return output:
      • z=3.000715

Analytics

plugin-python's People

Contributors

bdechenaux avatar yannrichet avatar

Watchers

 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.