Comments (8)
from geometric.
Can you use:
if isinstance(constraint, str):
...
elif isinstance(constraint, (tuple, list)):
...
else:
raise TypeError(...)
from geometric.
I think that could work - @yudongqiu , any thoughts?
Thanks,
- Lee-Ping
from geometric.
I think list of tuples can work, dictionary may also work, the main thing is we need to be careful that it fully reproduces the original functionality.
from geometric.
Currently, an example of the constraints input string looks like this:
$freeze
xyz 1-5
$set
angle 2 1 5 110.0
# A comment
$scan
distance 2 1 1.0 1.2 3 # Another comment
dihedral 1 5 6 7 110.0 150.0 3
This corresponds to a dictionary that looks like this:
{
'freeze' : [('xyz', '1-5')],
'set' : [('angle', '2', '1', '5', '110.0')],
'scan' : [('distance', '2', '1', '1.0', '1.2', '3'),
('dihedral', '1', '5', '6', '7', '110.0', '150.0', '3')]
}
I think we can easily have the JSON constraint input be a dictionary like the one above. It's much easier if we require all of the elements in each tuple to be "words" (i.e. strings without spaces). If so, all we need to do is write an extra function to convert the dictionary to the constraints input string and pass that to optimize.py::ParseConstraints()
without modifying the latter.
from geometric.
I understand the alternative is to rewrite optimize.py::ParseConstraints()
so that it supports multiple input types, but I don't see how that is possible without substantially restructuring it. That function is quite complicated because it supports simultaneous freezing / setting / scanning of various combinations of constraints.
from geometric.
@leeping Thanks a lot for the clear specs of the new constraints input format. I will implement that and make a PR soon.
from geometric.
Addressed in PR #27 .
from geometric.
Related Issues (20)
- Energy restraints and PES modification design
- "pip install geometric" installs an outdated version, incompatible with recent pyscf HOT 1
- Cryptic error messages when trying to constrain linear torsions HOT 1
- Virtual site HOT 7
- ORCA support request HOT 4
- optimizer crash HOT 4
- New minor release? HOT 5
- [BUG] Logging configuration update causes issue in default case of no logging configured HOT 6
- [BUG] Running Transition=True fails with geometric_run_json HOT 1
- Using all the cores while minimizing the structure HOT 1
- AttributeError: 'CartesianCoordinates' object has no attribute 'Prims' HOT 2
- geomeTRIC no longer producing .xyz file HOT 3
- TypeError when calling geomeTRIC from pyscf HOT 4
- Bug for constraints type "xyz" in run_json.py HOT 3
- Use of `os.exit` makes geomeTRIC unusable in pipelines HOT 2
- OpenMM warning log HOT 6
- Duplicate logging information HOT 4
- TURBOMOLE support? HOT 12
- Do geometric.internal.MultiDihedral constraints work? HOT 2
- Failed on creating a new Cartesian with the old Cartesian and the different in internal coordinate HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geometric.