Skip to content

up libs & version

up libs & version #93

Workflow file for this run

name: Examples
on:
push:
branches: [ master ]
tags: [ '*.*' ]
pull_request:
branches: [ master ]
jobs:
examples:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
Python: [3.7, 3.8, 3.9, 3.10]
runs-on: ${{matrix.os}}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'adopt'
- uses: actions/setup-python@v4
with:
python-version: ${{matrix.Python}}
- run: pip3 install --upgrade pip
shell: bash
- run: mkdir ${{matrix.os}}-Python${{matrix.Python}}
shell: bash
- run: pip3 install -r https://raw.githubusercontent.com/Funz/Funz.py/master/requirements.txt
- run: pip3 install git+https://github.com/Funz/Funz.py
- run: python3 -c "import Funz; Funz.installDesign('GradientDescent')" > ${{matrix.os}}-Python${{matrix.Python}}/install.out
shell: bash
- if: matrix.os == 'windows-latest'
run: python3 -c "import Funz, os, re; f=open(os.path.join(Funz.FUNZ_HOME,'calculator.xml'), 'r+'); text = f.read(); text = re.sub('.sh', '.bat', text); f.seek(0); f.write(text); f.truncate()" > ${{matrix.os}}-Python${{matrix.Python}}/install.out
shell: bash
- run: python3 -c "import Funz; calcs = Funz.startCalculators(5, stdout='|', stderr='|'); print([p.communicate() for p in calcs]);" > ${{matrix.os}}-Python${{matrix.Python}}/Calcs.out &
shell: bash
- run: python3 -c "import Funz, os, numpy; Funz.Run(model = 'Python',input_files = os.path.join(Funz.FUNZ_HOME,'samples','branin.py'),input_variables = {'x1':numpy.arange(0,1,0.2),'x2':numpy.arange(0,1,0.2)},all_combinations=True,output_expressions = 'z', archive_dir='${{matrix.os}}-Python${{matrix.Python}}/Run')" > ${{matrix.os}}-Python${{matrix.Python}}/Run.out
shell: bash
- run: python3 -c "import Funz, os, numpy; Funz.Design(fun=lambda X:abs(X['x1']*X['x2']),fun_control={'vectorize':'for'},design = 'GradientDescent', options = {'max_iterations':10},input_variables = {'x1':'[0,1]','x2':'[1,2]'}, archive_dir='${{matrix.os}}-Python${{matrix.Python}}/Design')" > ${{matrix.os}}-Python${{matrix.Python}}/Design.out
shell: bash
- run: python3 -c "import Funz, os, numpy; Funz.RunDesign(model='Python',input_files=os.path.join(Funz.FUNZ_HOME,'samples','branin.py'),output_expressions='z', design = 'GradientDescent',design_options = {'max_iterations':10},input_variables = {'x1':'[0,1]','x2':'[0,1]'}, archive_dir='${{matrix.os}}-Python${{matrix.Python}}/RunDesign')" > ${{matrix.os}}-Python${{matrix.Python}}/RunDesign.out
shell: bash
# - run: python3 -c "import Funz; Funz.stopCalculators(calcs)" >> Calcs.out
# shell: bash
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
path: ./${{matrix.os}}-*