From a844fc1a082db02f57d576f839e8b76f85a8e491 Mon Sep 17 00:00:00 2001 From: Kirsten Winther Date: Wed, 31 Oct 2018 13:45:49 -0700 Subject: [PATCH 1/8] fix initial settings and calculator name --- models.py | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/models.py b/models.py index c7912fd2..c63f6a40 100644 --- a/models.py +++ b/models.py @@ -27,6 +27,7 @@ import ase.atoms from ase.constraints import dict2constraint from ase.calculators.singlepoint import SinglePointCalculator +from ase.calculators.calculator import Calculator import ase.db.sqlite import ase.db.core import ase.io @@ -240,7 +241,6 @@ def _toatoms(self, include_results=False): cell=self.cell, pbc=(self.pbc & np.array([1, 2, 4])).astype(bool), ) - if self.constraints: constraints = json.loads(self.constraints) if len(constraints[0]['kwargs']['indices']) > 0: @@ -251,38 +251,35 @@ def _toatoms(self, include_results=False): self.positions, cell=self.cell, pbc=(self.pbc & np.array([1, 2, 4])).astype(bool), - magmoms=self.magmoms, - charges=self.charges, + magmoms=self.initial_magmoms, + charges=self.initial_charges, tags=self.tags, masses=self.masses, momenta=self.momenta, constraint=constraints) + atoms.info = {} + atoms.info['unique_id'] = self.unique_id + atoms.info['key_value_pairs'] = self.key_value_pairs + + data = self.data + if data: + atoms.info['data'] = data if not self.calculator == "unknown": - params = self.get('calculator_parameters', {}) - atoms.calc = get_calculator(self.calculator)(**params) + params = self.calculator_parameters + atoms.calc = Calculator(self.calculator, **params) + atoms.calc.name = self.calculator else: all_properties = ['energy', 'forces', 'stress', 'dipole', 'charges', 'magmom', 'magmoms', 'free_energy'] results = {} - #print(getattr(self, 'energy')) for prop in all_properties: result = getattr(self, prop, None) if result is not None: results[prop] = result - # print(results) if results: atoms.calc = SinglePointCalculator(atoms, **results) atoms.calc.name = getattr(self, 'calculator', 'unknown') - - atoms.info = {} - atoms.info['unique_id'] = self.unique_id - atoms.info['key_value_pairs'] = self.key_value_pairs - - data = self.data - if data: - atoms.info['data'] = data - return atoms @hybrid_property From 07f97d3647fc57e8ec98515c3a69970568039fec Mon Sep 17 00:00:00 2001 From: Kirsten Winther Date: Wed, 31 Oct 2018 14:37:15 -0700 Subject: [PATCH 2/8] update ase, softer requirements --- requirements.template | 96 +++++++++++++++++++++---------------------- requirements.txt | 96 +++++++++++++++++++++---------------------- 2 files changed, 96 insertions(+), 96 deletions(-) diff --git a/requirements.template b/requirements.template index 9fae7e90..183e4805 100644 --- a/requirements.template +++ b/requirements.template @@ -1,56 +1,56 @@ # DO NOT EDIT requirements.txt DIRECTLY OR ADD IT TO VERSION CONTROL # It will be overwritten in the install progress # Add new packages in requirements.template instead. -ase==3.16.0 -backports.functools-lru-cache==1.4 +ase>=3.16.1 +backports.functools-lru-cache>=1.4 catkit>=0.5.3 git+https://github.com/SUNCAT-Center/CatLearn.git@06bbfd370306ae6ecbfee50fd48b5f0a6ff5ef31#egg=catlearn git+https://github.com/SUNCAT-Center/CatHub.git#egg=cathub BulkEnumerator-0.0.2-cp36-cp36m-linux_x86_64.whl -blinker==1.4 -click==6.7 -coverage==4.4.2 -cycler==0.10.0 -FireWorks==1.6.9 -Flask==0.12.2 -Flask-Cors==3.0.3 -Flask-GraphQL==1.4.1 -Flask-Script==2.0.6 -Flask-SQLAlchemy==2.3.2 -graphene==2.0.dev20170802065539 -graphene-sqlalchemy==2.0.dev2017083101 -graphql-core==2.0.dev20171009101843 -graphql-relay==0.4.5 -graphql-server-core==1.0.dev20170322001 -gunicorn==19.7.1 -h5py==2.7.1 -iso8601==0.1.12 -itsdangerous==0.24 -Jinja2==2.9.6 -MarkupSafe==1.0 -matplotlib==2.1.0 -mendeleev==0.4.2 -nose==1.3.7 -numpy==1.13.3 -pandas==0.20.3 -promise==2.1.dev20170724043809 -psycopg2==2.7.3.2 -pudb==2017.1.4 -Pygments==2.2.0 -pymatgen==2018.3.23 -pyparsing==2.2.0 -python-dateutil==2.6.1 -pytz==2017.2 +blinker>=1.4 +click>=6.7 +coverage>=4.4.2 +cycler>=0.10.0 +FireWorks>=1.6.9 +Flask>=0.12.2 +Flask-Cors>=3.0.3 +Flask-GraphQL>=1.4.1 +Flask-Script>=2.0.6 +Flask-SQLAlchemy>=2.3.2 +graphene>=2.0.dev20170802065539 +graphene-sqlalchemy>=2.0.dev2017083101 +graphql-core>=2.0.dev20171009101843 +graphql-relay>=0.4.5 +graphql-server-core>=1.0.dev20170322001 +gunicorn>=19.7.1 +h5py>=2.7.1 +iso8601>=0.1.12 +itsdangerous>=0.24 +Jinja2>=2.9.6 +MarkupSafe>=1.0 +matplotlib>=2.1.0 +mendeleev>=0.4.2 +nose>=1.3.7 +numpy>=1.13.3 +pandas>=0.20.3 +promise>=2.1.dev20170724043809 +psycopg2>=2.7.3.2 +pudb>=2017.1.4 +Pygments>=2.2.0 +pymatgen>=2018.3.23 +pyparsing>=2.2.0 +python-dateutil>=2.6.1 +pytz>=2017.2 raven>=3 -requests-oauthlib==1.0.0 -scikit-learn==0.19.1 -scipy==0.19.1 -seaborn==0.8.1 -sendgrid==5.4.1 -singledispatch==3.4.0.3 -six==1.11.0 -SQLAlchemy==1.1.14 -typing==3.6.2 -tqdm==4.19.5 -urwid==1.3.1 -Werkzeug==0.12.2 +requests-oauthlib>=1.0.0 +scikit-learn>=0.19.1 +scipy>=0.19.1 +seaborn>=0.8.1 +sendgrid>=5.4.1 +singledispatch>=3.4.0.3 +six>=1.11.0 +SQLAlchemy>=1.1.14 +typing>=3.6.2 +tqdm>=4.19.5 +urwid>=1.3.1 +Werkzeug>=0.12.2 diff --git a/requirements.txt b/requirements.txt index c5e7a4c8..5ce98d1e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,55 +1,55 @@ # DO NOT EDIT requirements.txt DIRECTLY OR ADD IT TO VERSION CONTROL # It will be overwritten in the install progress # Add new packages in requirements.template instead. -ase==3.16.0 -backports.functools-lru-cache==1.4 +ase>=3.16.1 +backports.functools-lru-cache>=1.4 catkit>=0.5.3 git+https://github.com/SUNCAT-Center/CatLearn.git@06bbfd370306ae6ecbfee50fd48b5f0a6ff5ef31#egg=catlearn git+https://github.com/SUNCAT-Center/CatHub.git#egg=cathub -blinker==1.4 -click==6.7 -coverage==4.4.2 -cycler==0.10.0 -FireWorks==1.6.9 -Flask==0.12.2 -Flask-Cors==3.0.3 -Flask-GraphQL==1.4.1 -Flask-Script==2.0.6 -Flask-SQLAlchemy==2.3.2 -graphene==2.0.dev20170802065539 -graphene-sqlalchemy==2.0.dev2017083101 -graphql-core==2.0.dev20171009101843 -graphql-relay==0.4.5 -graphql-server-core==1.0.dev20170322001 -gunicorn==19.7.1 -h5py==2.7.1 -iso8601==0.1.12 -itsdangerous==0.24 -Jinja2==2.9.6 -MarkupSafe==1.0 -matplotlib==2.1.0 -mendeleev==0.4.2 -nose==1.3.7 -numpy==1.13.3 -pandas==0.20.3 -promise==2.1.dev20170724043809 -psycopg2==2.7.3.2 -pudb==2017.1.4 -Pygments==2.2.0 -pymatgen==2018.3.23 -pyparsing==2.2.0 -python-dateutil==2.6.1 -pytz==2017.2 +blinker>=1.4 +click>=6.7 +coverage>=4.4.2 +cycler>=0.10.0 +FireWorks>=1.6.9 +Flask>=0.12.2 +Flask-Cors>=3.0.3 +Flask-GraphQL>=1.4.1 +Flask-Script>=2.0.6 +Flask-SQLAlchemy>=2.3.2 +graphene>=2.0.dev20170802065539 +graphene-sqlalchemy>=2.0.dev2017083101 +graphql-core>=2.0.dev20171009101843 +graphql-relay>=0.4.5 +graphql-server-core>=1.0.dev20170322001 +gunicorn>=19.7.1 +h5py>=2.7.1 +iso8601>=0.1.12 +itsdangerous>=0.24 +Jinja2>=2.9.6 +MarkupSafe>=1.0 +matplotlib>=2.1.0 +mendeleev>=0.4.2 +nose>=1.3.7 +numpy>=1.13.3 +pandas>=0.20.3 +promise>=2.1.dev20170724043809 +psycopg2>=2.7.3.2 +pudb>=2017.1.4 +Pygments>=2.2.0 +pymatgen>=2018.3.23 +pyparsing>=2.2.0 +python-dateutil>=2.6.1 +pytz>=2017.2 raven>=3 -requests-oauthlib==1.0.0 -scikit-learn==0.19.1 -scipy==0.19.1 -seaborn==0.8.1 -sendgrid==5.4.1 -singledispatch==3.4.0.3 -six==1.11.0 -SQLAlchemy==1.1.14 -typing==3.6.2 -tqdm==4.19.5 -urwid==1.3.1 -Werkzeug==0.12.2 +requests-oauthlib>=1.0.0 +scikit-learn>=0.19.1 +scipy>=0.19.1 +seaborn>=0.8.1 +sendgrid>=5.4.1 +singledispatch>=3.4.0.3 +six>=1.11.0 +SQLAlchemy>=1.1.14 +typing>=3.6.2 +tqdm>=4.19.5 +urwid>=1.3.1 +Werkzeug>=0.12.2 From 49203cfe88e759609b291c4ecb4d09cc36c56650 Mon Sep 17 00:00:00 2001 From: Kirsten Winther Date: Mon, 12 Nov 2018 10:53:32 -0800 Subject: [PATCH 3/8] update admin emails --- apps/upload/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/upload/__init__.py b/apps/upload/__init__.py index c806d46d..a85b048b 100644 --- a/apps/upload/__init__.py +++ b/apps/upload/__init__.py @@ -43,7 +43,7 @@ log = logging.getLogger(__name__) log.setLevel(logging.DEBUG) -ADMIN_EMAILS = ['maxjh@stanford.edu', 'winther@stanford.edu'] +ADMIN_EMAILS = ['winther@stanford.edu', 'bajdich@stanford.edu'] FRONTEND_URL = 'https://www.catalysis-hub.org' upload = flask.Blueprint('upload', __name__) From 35e3eefc803eacc978fd9890010e688cfb4a6ff8 Mon Sep 17 00:00:00 2001 From: Kirsten Winther Date: Mon, 12 Nov 2018 11:00:38 -0800 Subject: [PATCH 4/8] reintroduce strick requirements - something in graphql fails --- requirements.template | 96 +++++++++++++++++++++---------------------- requirements.txt | 96 +++++++++++++++++++++---------------------- 2 files changed, 96 insertions(+), 96 deletions(-) diff --git a/requirements.template b/requirements.template index 183e4805..8ece107a 100644 --- a/requirements.template +++ b/requirements.template @@ -1,56 +1,56 @@ # DO NOT EDIT requirements.txt DIRECTLY OR ADD IT TO VERSION CONTROL # It will be overwritten in the install progress # Add new packages in requirements.template instead. -ase>=3.16.1 -backports.functools-lru-cache>=1.4 +ase>=3.16.2 +backports.functools-lru-cache==1.4 catkit>=0.5.3 git+https://github.com/SUNCAT-Center/CatLearn.git@06bbfd370306ae6ecbfee50fd48b5f0a6ff5ef31#egg=catlearn git+https://github.com/SUNCAT-Center/CatHub.git#egg=cathub BulkEnumerator-0.0.2-cp36-cp36m-linux_x86_64.whl -blinker>=1.4 -click>=6.7 -coverage>=4.4.2 -cycler>=0.10.0 -FireWorks>=1.6.9 -Flask>=0.12.2 -Flask-Cors>=3.0.3 -Flask-GraphQL>=1.4.1 -Flask-Script>=2.0.6 -Flask-SQLAlchemy>=2.3.2 -graphene>=2.0.dev20170802065539 -graphene-sqlalchemy>=2.0.dev2017083101 -graphql-core>=2.0.dev20171009101843 -graphql-relay>=0.4.5 -graphql-server-core>=1.0.dev20170322001 -gunicorn>=19.7.1 -h5py>=2.7.1 -iso8601>=0.1.12 -itsdangerous>=0.24 -Jinja2>=2.9.6 -MarkupSafe>=1.0 -matplotlib>=2.1.0 -mendeleev>=0.4.2 -nose>=1.3.7 -numpy>=1.13.3 -pandas>=0.20.3 -promise>=2.1.dev20170724043809 -psycopg2>=2.7.3.2 -pudb>=2017.1.4 -Pygments>=2.2.0 -pymatgen>=2018.3.23 -pyparsing>=2.2.0 -python-dateutil>=2.6.1 -pytz>=2017.2 +blinker==1.4 +click==6.7 +coverage==4.4.2 +cycler==0.10.0 +FireWorks==1.6.9 +Flask==0.12.2 +Flask-Cors==3.0.3 +Flask-GraphQL==1.4.1 +Flask-Script==2.0.6 +Flask-SQLAlchemy==2.3.2 +graphene==2.0.dev20170802065539 +graphene-sqlalchemy==2.0.dev2017083101 +graphql-core==2.0.dev20171009101843 +graphql-relay==0.4.5 +graphql-server-core==1.0.dev20170322001 +gunicorn==19.7.1 +h5py==2.7.1 +iso8601==0.1.12 +itsdangerous==0.24 +Jinja2==2.9.6 +MarkupSafe==1.0 +matplotlib==2.1.0 +mendeleev==0.4.2 +nose==1.3.7 +numpy==1.13.3 +pandas==0.20.3 +promise==2.1.dev20170724043809 +psycopg2==2.7.3.2 +pudb==2017.1.4 +Pygments==2.2.0 +pymatgen==2018.3.23 +pyparsing==2.2.0 +python-dateutil==2.6.1 +pytz==2017.2 raven>=3 -requests-oauthlib>=1.0.0 -scikit-learn>=0.19.1 -scipy>=0.19.1 -seaborn>=0.8.1 -sendgrid>=5.4.1 -singledispatch>=3.4.0.3 -six>=1.11.0 -SQLAlchemy>=1.1.14 -typing>=3.6.2 -tqdm>=4.19.5 -urwid>=1.3.1 -Werkzeug>=0.12.2 +requests-oauthlib==1.0.0 +scikit-learn==0.19.1 +scipy==0.19.1 +seaborn==0.8.1 +sendgrid==5.4.1 +singledispatch==3.4.0.3 +six==1.11.0 +SQLAlchemy==1.1.14 +typing==3.6.2 +tqdm==4.19.5 +urwid==1.3.1 +Werkzeug==0.12.2 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 5ce98d1e..61145ffc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,55 +1,55 @@ # DO NOT EDIT requirements.txt DIRECTLY OR ADD IT TO VERSION CONTROL # It will be overwritten in the install progress # Add new packages in requirements.template instead. -ase>=3.16.1 -backports.functools-lru-cache>=1.4 +ase>=3.16.2 +backports.functools-lru-cache==1.4 catkit>=0.5.3 git+https://github.com/SUNCAT-Center/CatLearn.git@06bbfd370306ae6ecbfee50fd48b5f0a6ff5ef31#egg=catlearn git+https://github.com/SUNCAT-Center/CatHub.git#egg=cathub -blinker>=1.4 -click>=6.7 -coverage>=4.4.2 -cycler>=0.10.0 -FireWorks>=1.6.9 -Flask>=0.12.2 -Flask-Cors>=3.0.3 -Flask-GraphQL>=1.4.1 -Flask-Script>=2.0.6 -Flask-SQLAlchemy>=2.3.2 -graphene>=2.0.dev20170802065539 -graphene-sqlalchemy>=2.0.dev2017083101 -graphql-core>=2.0.dev20171009101843 -graphql-relay>=0.4.5 -graphql-server-core>=1.0.dev20170322001 -gunicorn>=19.7.1 -h5py>=2.7.1 -iso8601>=0.1.12 -itsdangerous>=0.24 -Jinja2>=2.9.6 -MarkupSafe>=1.0 -matplotlib>=2.1.0 -mendeleev>=0.4.2 -nose>=1.3.7 -numpy>=1.13.3 -pandas>=0.20.3 -promise>=2.1.dev20170724043809 -psycopg2>=2.7.3.2 -pudb>=2017.1.4 -Pygments>=2.2.0 -pymatgen>=2018.3.23 -pyparsing>=2.2.0 -python-dateutil>=2.6.1 -pytz>=2017.2 +blinker==1.4 +click==6.7 +coverage==4.4.2 +cycler==0.10.0 +FireWorks==1.6.9 +Flask==0.12.2 +Flask-Cors==3.0.3 +Flask-GraphQL==1.4.1 +Flask-Script==2.0.6 +Flask-SQLAlchemy==2.3.2 +graphene==2.0.dev20170802065539 +graphene-sqlalchemy==2.0.dev2017083101 +graphql-core==2.0.dev20171009101843 +graphql-relay==0.4.5 +graphql-server-core==1.0.dev20170322001 +gunicorn==19.7.1 +h5py==2.7.1 +iso8601==0.1.12 +itsdangerous==0.24 +Jinja2==2.9.6 +MarkupSafe==1.0 +matplotlib==2.1.0 +mendeleev==0.4.2 +nose==1.3.7 +numpy==1.13.3 +pandas==0.20.3 +promise==2.1.dev20170724043809 +psycopg2==2.7.3.2 +pudb==2017.1.4 +Pygments==2.2.0 +pymatgen==2018.3.23 +pyparsing==2.2.0 +python-dateutil==2.6.1 +pytz==2017.2 raven>=3 -requests-oauthlib>=1.0.0 -scikit-learn>=0.19.1 -scipy>=0.19.1 -seaborn>=0.8.1 -sendgrid>=5.4.1 -singledispatch>=3.4.0.3 -six>=1.11.0 -SQLAlchemy>=1.1.14 -typing>=3.6.2 -tqdm>=4.19.5 -urwid>=1.3.1 -Werkzeug>=0.12.2 +requests-oauthlib==1.0.0 +scikit-learn==0.19.1 +scipy==0.19.1 +seaborn==0.8.1 +sendgrid==5.4.1 +singledispatch==3.4.0.3 +six==1.11.0 +SQLAlchemy==1.1.14 +typing==3.6.2 +tqdm==4.19.5 +urwid==1.3.1 +Werkzeug==0.12.2 From 07260dc675a5f4a2b0842513751a657ddb71925a Mon Sep 17 00:00:00 2001 From: Kirsten Winther Date: Mon, 12 Nov 2018 11:20:12 -0800 Subject: [PATCH 5/8] follow up with ase string2sym change --- apps/catlearn/atomistic.py | 4 ++-- apps/prototypeSearch/__init__.py | 2 +- apps/utils/gas_phase_references.py | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/catlearn/atomistic.py b/apps/catlearn/atomistic.py index e4110017..00894dbc 100644 --- a/apps/catlearn/atomistic.py +++ b/apps/catlearn/atomistic.py @@ -40,8 +40,8 @@ def predict_catkit_demo(images): for atoms in images: try: initial_state = [model_ref[s] for s in - ase.atoms.string2symbols( - atoms.info['key_value_pairs']['species'])] + ase.symbols.string2symbols( + atoms.info['key_value_pairs']['species'])] except KeyError: return {} display_ref.append( diff --git a/apps/prototypeSearch/__init__.py b/apps/prototypeSearch/__init__.py index 3f17953a..51a314ec 100644 --- a/apps/prototypeSearch/__init__.py +++ b/apps/prototypeSearch/__init__.py @@ -23,7 +23,7 @@ import StringIO import numpy as np -from ase.atoms import string2symbols +from ase.symbols import string2symbols import flask from flask_cors import CORS diff --git a/apps/utils/gas_phase_references.py b/apps/utils/gas_phase_references.py index a479eed8..dc755706 100644 --- a/apps/utils/gas_phase_references.py +++ b/apps/utils/gas_phase_references.py @@ -12,8 +12,8 @@ def molecules2symbols(molecules, add_hydrogen=True): symbols = sorted( list(set( - ase.atoms.string2symbols(''.join( - map(lambda _x: ''.join(ase.atoms.string2symbols(_x)), molecules) + ase.symbols.string2symbols(''.join( + map(lambda _x: ''.join(ase.symbols.string2symbols(_x)), molecules) )) )), key=lambda _y: ase.data.atomic_numbers[_y]) @@ -38,7 +38,7 @@ def construct_reference_system(symbols, candidates=['H2', 'H2O', 'NH3', 'CH4', ' for symbol in symbols: added_symbols.append(symbol) for candidate in candidates: - symbols = ase.atoms.string2symbols(candidate) + symbols = ase.symbols.string2symbols(candidate) if set(added_symbols) == set(list(references.keys()) + symbols): references[symbol] = candidate @@ -69,7 +69,7 @@ def get_atomic_stoichiometry(references): species = species.split('_')[0] key_index[key] = i - composition = ase.atoms.string2symbols(species) + composition = ase.symbols.string2symbols(species) for j, symbol in enumerate(composition): if symbol == key: stoichiometry[i, i] += 1 @@ -97,7 +97,7 @@ def get_stoichiometry_factors(adsorbates, references): stoichiometry = get_atomic_stoichiometry(references) stoichiometry_factors = {} for adsorbate in adsorbates: - for symbol in ase.atoms.string2symbols(adsorbate): + for symbol in ase.symbols.string2symbols(adsorbate): symbol_index = list( map(lambda _x: _x[0], references)).index(symbol) From 08571cb42852546cb9bf0c229c12b3a0eafbbb41 Mon Sep 17 00:00:00 2001 From: Kirsten Winther Date: Mon, 12 Nov 2018 11:20:12 -0800 Subject: [PATCH 6/8] follow up with ase string2sym change --- apps/catlearn/atomistic.py | 4 ++-- apps/pourbaix/pourbaix_ase/pourbaix_plot.py | 2 +- apps/prototypeSearch/__init__.py | 2 +- apps/utils/gas_phase_references.py | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/catlearn/atomistic.py b/apps/catlearn/atomistic.py index e4110017..00894dbc 100644 --- a/apps/catlearn/atomistic.py +++ b/apps/catlearn/atomistic.py @@ -40,8 +40,8 @@ def predict_catkit_demo(images): for atoms in images: try: initial_state = [model_ref[s] for s in - ase.atoms.string2symbols( - atoms.info['key_value_pairs']['species'])] + ase.symbols.string2symbols( + atoms.info['key_value_pairs']['species'])] except KeyError: return {} display_ref.append( diff --git a/apps/pourbaix/pourbaix_ase/pourbaix_plot.py b/apps/pourbaix/pourbaix_ase/pourbaix_plot.py index 46b980e2..e9cab30c 100644 --- a/apps/pourbaix/pourbaix_ase/pourbaix_plot.py +++ b/apps/pourbaix/pourbaix_ase/pourbaix_plot.py @@ -9,7 +9,7 @@ from scipy.spatial import ConvexHull import ase.units as units -from ase.atoms import string2symbols +from ase.symbols import string2symbols from ase.utils import formula_hill, basestring _solvated = [] diff --git a/apps/prototypeSearch/__init__.py b/apps/prototypeSearch/__init__.py index 3f17953a..51a314ec 100644 --- a/apps/prototypeSearch/__init__.py +++ b/apps/prototypeSearch/__init__.py @@ -23,7 +23,7 @@ import StringIO import numpy as np -from ase.atoms import string2symbols +from ase.symbols import string2symbols import flask from flask_cors import CORS diff --git a/apps/utils/gas_phase_references.py b/apps/utils/gas_phase_references.py index a479eed8..dc755706 100644 --- a/apps/utils/gas_phase_references.py +++ b/apps/utils/gas_phase_references.py @@ -12,8 +12,8 @@ def molecules2symbols(molecules, add_hydrogen=True): symbols = sorted( list(set( - ase.atoms.string2symbols(''.join( - map(lambda _x: ''.join(ase.atoms.string2symbols(_x)), molecules) + ase.symbols.string2symbols(''.join( + map(lambda _x: ''.join(ase.symbols.string2symbols(_x)), molecules) )) )), key=lambda _y: ase.data.atomic_numbers[_y]) @@ -38,7 +38,7 @@ def construct_reference_system(symbols, candidates=['H2', 'H2O', 'NH3', 'CH4', ' for symbol in symbols: added_symbols.append(symbol) for candidate in candidates: - symbols = ase.atoms.string2symbols(candidate) + symbols = ase.symbols.string2symbols(candidate) if set(added_symbols) == set(list(references.keys()) + symbols): references[symbol] = candidate @@ -69,7 +69,7 @@ def get_atomic_stoichiometry(references): species = species.split('_')[0] key_index[key] = i - composition = ase.atoms.string2symbols(species) + composition = ase.symbols.string2symbols(species) for j, symbol in enumerate(composition): if symbol == key: stoichiometry[i, i] += 1 @@ -97,7 +97,7 @@ def get_stoichiometry_factors(adsorbates, references): stoichiometry = get_atomic_stoichiometry(references) stoichiometry_factors = {} for adsorbate in adsorbates: - for symbol in ase.atoms.string2symbols(adsorbate): + for symbol in ase.symbols.string2symbols(adsorbate): symbol_index = list( map(lambda _x: _x[0], references)).index(symbol) From 5469df553d33f64c52d5c349afde33fc755066de Mon Sep 17 00:00:00 2001 From: Kirsten Winther Date: Mon, 12 Nov 2018 11:42:20 -0800 Subject: [PATCH 7/8] old ase for catlearn --- apps/catlearn/atomistic.py | 2 +- apps/pourbaix/pourbaix_ase/pourbaix_plot.py | 2 +- apps/prototypeSearch/__init__.py | 2 +- apps/utils/gas_phase_references.py | 11 ++++++----- requirements.template | 2 +- requirements.txt | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/apps/catlearn/atomistic.py b/apps/catlearn/atomistic.py index 00894dbc..5581bb72 100644 --- a/apps/catlearn/atomistic.py +++ b/apps/catlearn/atomistic.py @@ -40,7 +40,7 @@ def predict_catkit_demo(images): for atoms in images: try: initial_state = [model_ref[s] for s in - ase.symbols.string2symbols( + ase.atoms.string2symbols( atoms.info['key_value_pairs']['species'])] except KeyError: return {} diff --git a/apps/pourbaix/pourbaix_ase/pourbaix_plot.py b/apps/pourbaix/pourbaix_ase/pourbaix_plot.py index e9cab30c..46b980e2 100644 --- a/apps/pourbaix/pourbaix_ase/pourbaix_plot.py +++ b/apps/pourbaix/pourbaix_ase/pourbaix_plot.py @@ -9,7 +9,7 @@ from scipy.spatial import ConvexHull import ase.units as units -from ase.symbols import string2symbols +from ase.atoms import string2symbols from ase.utils import formula_hill, basestring _solvated = [] diff --git a/apps/prototypeSearch/__init__.py b/apps/prototypeSearch/__init__.py index 51a314ec..3f17953a 100644 --- a/apps/prototypeSearch/__init__.py +++ b/apps/prototypeSearch/__init__.py @@ -23,7 +23,7 @@ import StringIO import numpy as np -from ase.symbols import string2symbols +from ase.atoms import string2symbols import flask from flask_cors import CORS diff --git a/apps/utils/gas_phase_references.py b/apps/utils/gas_phase_references.py index dc755706..3d423c11 100644 --- a/apps/utils/gas_phase_references.py +++ b/apps/utils/gas_phase_references.py @@ -3,6 +3,7 @@ import numpy as np from numpy import array +from ase.atoms import string2symbols def molecules2symbols(molecules, add_hydrogen=True): """ @@ -12,8 +13,8 @@ def molecules2symbols(molecules, add_hydrogen=True): symbols = sorted( list(set( - ase.symbols.string2symbols(''.join( - map(lambda _x: ''.join(ase.symbols.string2symbols(_x)), molecules) + string2symbols(''.join( + map(lambda _x: ''.join(string2symbols(_x)), molecules) )) )), key=lambda _y: ase.data.atomic_numbers[_y]) @@ -38,7 +39,7 @@ def construct_reference_system(symbols, candidates=['H2', 'H2O', 'NH3', 'CH4', ' for symbol in symbols: added_symbols.append(symbol) for candidate in candidates: - symbols = ase.symbols.string2symbols(candidate) + symbols = string2symbols(candidate) if set(added_symbols) == set(list(references.keys()) + symbols): references[symbol] = candidate @@ -69,7 +70,7 @@ def get_atomic_stoichiometry(references): species = species.split('_')[0] key_index[key] = i - composition = ase.symbols.string2symbols(species) + composition = string2symbols(species) for j, symbol in enumerate(composition): if symbol == key: stoichiometry[i, i] += 1 @@ -97,7 +98,7 @@ def get_stoichiometry_factors(adsorbates, references): stoichiometry = get_atomic_stoichiometry(references) stoichiometry_factors = {} for adsorbate in adsorbates: - for symbol in ase.symbols.string2symbols(adsorbate): + for symbol in string2symbols(adsorbate): symbol_index = list( map(lambda _x: _x[0], references)).index(symbol) diff --git a/requirements.template b/requirements.template index 8ece107a..ca48a478 100644 --- a/requirements.template +++ b/requirements.template @@ -1,7 +1,7 @@ # DO NOT EDIT requirements.txt DIRECTLY OR ADD IT TO VERSION CONTROL # It will be overwritten in the install progress # Add new packages in requirements.template instead. -ase>=3.16.2 +ase==3.16.2 backports.functools-lru-cache==1.4 catkit>=0.5.3 git+https://github.com/SUNCAT-Center/CatLearn.git@06bbfd370306ae6ecbfee50fd48b5f0a6ff5ef31#egg=catlearn diff --git a/requirements.txt b/requirements.txt index 61145ffc..c5e7a4c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # DO NOT EDIT requirements.txt DIRECTLY OR ADD IT TO VERSION CONTROL # It will be overwritten in the install progress # Add new packages in requirements.template instead. -ase>=3.16.2 +ase==3.16.0 backports.functools-lru-cache==1.4 catkit>=0.5.3 git+https://github.com/SUNCAT-Center/CatLearn.git@06bbfd370306ae6ecbfee50fd48b5f0a6ff5ef31#egg=catlearn From 5fd59ce8c84ff3dcf75f016d51e4bbda9daeaadd Mon Sep 17 00:00:00 2001 From: Kirsten Winther Date: Mon, 12 Nov 2018 13:19:26 -0800 Subject: [PATCH 8/8] read catlearn model to slug --- .slugignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.slugignore b/.slugignore index 74918ce0..8b137891 100644 --- a/.slugignore +++ b/.slugignore @@ -1 +1 @@ -/apps/catlearn/models/metals_catlearn_gp.pkl +