Commit b18326a7 authored by Blais, Chris's avatar Blais, Chris
Browse files

updates for running and plotting minimal layout

parent 25c05734
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
import os
import sys

if sys.platform == "win32":
    soar_path = os.path.join(r"C:\Users\tjf\Documents\01_gitlab_repos\soar\python")
elif sys.platform == "linux":
    soar_path = os.path.join("/home/tjf/01_nawi/soar/python")
    
if soar_path not in sys.path:
    sys.path.insert(0, soar_path)
else:
    print("soar toolbox already in path")

# add module path
module_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if module_path not in sys.path:
    sys.path.insert(0, module_path)
else:
    print("path already in sys.path")

+646 −0

File added.

Preview size limit exceeded, changes collapsed.

+7 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ import numpy as np
import matplotlib.pyplot as plt
import copy
import sympy as sy
from context import *

def plot_bl_layout(layout_plt, varbs_bl):

@@ -46,7 +47,7 @@ def plot_layout_any(layout_plt, layout_name, varbs,
                    x_coords = [], y_coords = [], 
                    xoff=120, yoff=0,
                    fontsize=25, figsize=(45,20),
                    title = ""
                    title = "",
                    ):

    """
@@ -136,7 +137,12 @@ def plot_layout_any(layout_plt, layout_name, varbs,
            ax.text(
                coords[0], coords[1], names[i], fontsize=fontsize, color = "grey", alpha = 0.5,
                ) # m1
            
    fig_path = os.path.join(module_path, "testing", "plots")
    ax.text(800, 50, title, fontsize = 50, )
    fig_name = title.replace(" ", "_")
    fig.savefig(os.path.join(fig_path, fig_name), bbox_inches="tight")


def make_pretty_labels(varbs, layout):

+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import matplotlib.pyplot as plt
# compare to soar
from numerical_labelling.constraints import labelConstraint
from numerical_labelling.labelling import jacsym
from generate_numerical_system import constr_minimal, constr_ccro, constr_pilot
from testing.generate_numerical_system import constr_minimal, constr_ccro, constr_pilot

def build_test_case(ptype=1, system = "ccro", debug=False):
    """