Skip to content

Commit

Permalink
Merge pull request #7 from jezsadler/main
Browse files Browse the repository at this point in the history
Merging in Keras 3 etc
  • Loading branch information
jezsadler authored May 17, 2024
2 parents e222424 + bd8b9d7 commit ec8af37
Show file tree
Hide file tree
Showing 62 changed files with 2,778 additions and 1,746 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
name: CI

on:
push:
branches: ["main","github-actions"]
pull_request:
branches: ["main"]
workflow_dispatch:

jobs:
tests:
name: "Python ${{ matrix.python-version }}"
runs-on: "ubuntu-latest"

strategy:
matrix:
# python-version: ["3.7", "3.8", "3.9"]
python-version: ["3.8", "3.9", "3.10"]

steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
- uses: "s-weigand/setup-conda@v1"
with:
python-version: "${{ matrix.python-version }}"

- name: Install solvers
run: sudo apt-get install -y glpk-utils coinor-cbc

- name: "Install dependencies"
run: |
set -xe
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions
conda install -c conda-forge ipopt
conda install -c conda-forge pyscipopt
- name: "Run tox targets with lean testing environment for ${{ matrix.python-version }}"
run: "tox -re leanenv"

- name: "Run tox targets for ${{ matrix.python-version }}"
run: "tox"

# - name: "Run tox notebooks targets for ${{ matrix.python-version }}"
# run: |
# shopt -s globstar
# tox -e notebooks docs/**/*.ipynb

- name: "Convert coverage"
run: "python -m coverage xml"

- name: "Upload coverage to Codecov"
uses: "codecov/codecov-action@v2"
with:
fail_ci_if_error: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,4 @@ dmypy.json

# Pyre type checker
.pyre/
.vscode/settings.json
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import os
import sys
import inspect
import os
import shutil
import sys

# -- Path setup --------------------------------------------------------------

Expand Down Expand Up @@ -77,7 +77,7 @@
"sphinx.ext.doctest",
"sphinx.ext.ifconfig",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon"
"sphinx.ext.napoleon",
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -147,7 +147,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#html_theme = "furo"
# html_theme = "furo"
html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
Expand Down
17 changes: 11 additions & 6 deletions docs/notebooks/data/build_sin_quadratic_csv.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
from random import random

import numpy as np
import pandas as pd
from random import random

n_samples = 10000
w = 5

x = np.linspace(-2,2,n_samples)
df = pd.DataFrame(x, columns=['x'])
df['y'] = np.sin(w*x) + x**2 + np.array([np.random.uniform()*0.1 for _ in range(n_samples)])
x = np.linspace(-2, 2, n_samples)
df = pd.DataFrame(x, columns=["x"])
df["y"] = (
np.sin(w * x)
+ x**2
+ np.array([np.random.uniform() * 0.1 for _ in range(n_samples)])
)

plt.plot(df['x'],df['y'])
plt.plot(df["x"], df["y"])
plt.show()

df.to_csv("sin_quadratic.csv")
df.to_csv("sin_quadratic.csv")
256 changes: 134 additions & 122 deletions docs/notebooks/neuralnet/auto-thermal-reformer-relu.ipynb

Large diffs are not rendered by default.

414 changes: 218 additions & 196 deletions docs/notebooks/neuralnet/auto-thermal-reformer.ipynb

Large diffs are not rendered by default.

236 changes: 112 additions & 124 deletions docs/notebooks/neuralnet/graph_neural_network_formulation.ipynb

Large diffs are not rendered by default.

418 changes: 225 additions & 193 deletions docs/notebooks/neuralnet/import_network.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit ec8af37

Please sign in to comment.