Skip to content

Commit

Permalink
Merge pull request #48 from tachyontraveler/restful_v1
Browse files Browse the repository at this point in the history
REST query improvement, Changelog update, version indicator
  • Loading branch information
mohanliu authored Sep 17, 2019
2 parents d683f56 + d8126fd commit d06ab69
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ qmpy changelog
- Serialized DFT data availability with both default [OQMD](http://oqmd.org/static/docs/models.html) and [OPTiMaDe](http://www.optimade.org/) specified keyword-sets.
- [Lark Parser](https://lark-parser.readthedocs.io/en/latest/) to convert raw queries to logical Django Queries
- Pagination is implemented while retreiving RESTful query results
- Spglib upgraded to >1.9
- Removed dependency on pyspglib since it is no longer maintained by its developer(s)
- Significant changes to the internal implementation of Structure model, even though it's not expected to be affect the end-user
- More unit tests
- duplicate entry detection, structure transformations
- Change in UI of the landing page
- Removed the on-the-fly calculations of # of entries while loading the oqmd.org main page
- Removed the twitter based phase lookup instructions since it's no longer operational
Expand Down
2 changes: 2 additions & 0 deletions qmpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import django.core.exceptions as de

__version__ = 'qmpy version = 1.3'

INSTALL_PATH = os.path.abspath(os.path.dirname(__file__))
sys.path = [os.path.join(INSTALL_PATH, 'qmpy', 'db')] + sys.path

Expand Down
2 changes: 1 addition & 1 deletion qmpy/rester/qmpy_rester.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get_oqmd_phases(self, verbose=True, **kwargs):
if k in kwargs_list:
url_args.append('%s=%s' %(k, kwargs[k]))
elif k in filter_list:
if '>' in kwargs[k] or '<' in kwargs[k]:
if '>' in kwargs[k] or '<' in kwargs[k] or '!' in kwargs[k]:
filter_args.append('%s%s' %(k, kwargs[k]))
else:
filter_args.append('%s=%s' %(k, kwargs[k]))
Expand Down
8 changes: 4 additions & 4 deletions qmpy/utils/oqmd_optimade/QueryLarkDjangoParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def parse(self, filter_):
self.filter = filter_
return self.tree
except Exception as e:
#print(e)
# print(e)
return

def __repr__(self):
Expand Down Expand Up @@ -70,16 +70,16 @@ def gt(self,a,b):
return Q(**{a+'__gt':b})

def ge(self,a,b):
return Q(**{a+'__ge':b})
return Q(**{a+'__gte':b})

def lt(self,a,b):
return Q(**{a+'__lt':b})

def le(self,a,b):
return Q(**{a+'__le':b})
return Q(**{a+'__lte':b})

def ne(self,a,b):
return Q(**{a+'__ne':b})
return ~Q(**{a:b})

def not_(self,a):
return ~a
Expand Down

0 comments on commit d06ab69

Please sign in to comment.