Skip to content

Slightly better setup #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions paths.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# These are the paths for my laptop! I'm sure they're different for you, so update these so they're right.
# If you don't have them, just leave it as-is, but you won't be able to use autogen for that program.
Pcrystal: /home/brian/bin/Pcrystal
Pproperties: /home/brian/bin/Pproperties
crystal: /home/brian/bin/crystal
properties: /home/brian/bin/properties
pyscf: /home/brian/programs/pyscf
qwalk: /home/brian/bin/qwalk
18 changes: 10 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
import yaml
import os

print()
print("Setting up paths.")
print()
print("To use this, make sure you fill out 'paths.yaml'")
print("You'll need to know the location of Crystal, Crystal's properties component, QWalk,")
print("and the PySCF library if you want to use any of them in autogen.")
print("Use absolute paths.")
print("Use absolute paths where possible.")
print()

curpaths={}
keys=['Pcrystal','Pproperties','qwalk','pyscf']
keys=['crystal','Pcrystal','properties','Pproperties','qwalk','pyscf']

input_paths=yaml.load(open('paths.yaml'))

for key in sorted(keys):
path=input("--Enter path for %s (empty to disable): "%key)
if path=='':
path=None
if key in input_paths and os.path.exists(input_paths[key]):
path=input_paths[key]
curpaths[key]=path
else:
assert os.path.exists(path),\
"Couldn't find '%s', you should check that it exists, or that it's spelled correctly."%path
curpaths[key]=path
print("Didn't find path for %s, either update it in paths.json, or avoid using it with autogen."%key)

with open('autopaths.py','w') as outf:
outf.write('paths={}'.format(curpaths))
Expand Down