Skip to content

Commit

Permalink
Added version, checked examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherMayes committed Apr 23, 2020
1 parent 0cc48f8 commit b3a2221
Show file tree
Hide file tree
Showing 19 changed files with 567 additions and 1,593 deletions.
244 changes: 152 additions & 92 deletions examples/cnsga/cnsga_tnk.ipynb

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1,342 changes: 126 additions & 1,216 deletions examples/sampler/sampler_example.ipynb

Large diffs are not rendered by default.

464 changes: 235 additions & 229 deletions examples/xopt_class/xopt_astra_sampler.ipynb

Large diffs are not rendered by default.

83 changes: 41 additions & 42 deletions examples/xopt_class/xopt_tnk_example.ipynb

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions xopt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
from .xopt import Xopt
from .tools import xopt_logo


#import os
# Used to access examples directory
#root, _ = os.path.split(__file__)
#examples_dir = os.path.join(root, '../examples/')
from ._version import __version__
3 changes: 3 additions & 0 deletions xopt/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@


__version__ = '0.4.0'
6 changes: 3 additions & 3 deletions xopt/cnsga.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from xopt import creator, vocs_tools, fitness_with_constraints
from xopt.tools import full_path, random_settings_arrays, DummyExecutor, load_config

from ._version import __version__
from deap import algorithms, base, tools

import numpy as np
Expand All @@ -18,7 +18,7 @@
"""

cnsga_logo = """
cnsga_logo = f"""
▄████▄ ███▄ █ ██████ ▄████ ▄▄▄
Expand All @@ -34,7 +34,7 @@
Continuous Non-dominated Sorting Genetic Algorithm
Version {__version__}
"""


Expand Down
5 changes: 3 additions & 2 deletions xopt/sampler.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from .tools import full_path, new_date_filename, random_settings, DummyExecutor
from ._version import __version__
from deap.base import Toolbox
import json
import time
import os, sys


sampler_logo = """
sampler_logo = f"""
███████╗ █████╗ ███╗ ███╗██████╗ ██╗ ███████╗██████╗
██╔════╝██╔══██╗████╗ ████║██╔══██╗██║ ██╔════╝██╔══██╗
Expand All @@ -16,7 +17,7 @@
Xopt Random Sampler
Version {__version__}
"""


Expand Down
6 changes: 3 additions & 3 deletions xopt/xopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from .cnsga import cnsga
from .sampler import random_sampler
from .configure import configure_algorithm, configure_simulation, configure_vocs, VOCS_DEFAULTS
from ._version import __version__
import pprint
from copy import deepcopy
import yaml
Expand Down Expand Up @@ -274,11 +275,10 @@ def __getitem__(self, config_item):

def __repr__(self):
s = f"""
Xopt
Xopt
________________________________
Version: {__version__}
Configured: {self.configured}
Config as YAML:
"""
#return s+pprint.pformat(self.config)
Expand Down

0 comments on commit b3a2221

Please sign in to comment.