Skip to content

Commit

Permalink
1.9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
massgh committed Apr 26, 2022
1 parent 7860113 commit e5aaf44
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Vasp2Visual/Vasp2Visual.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'RootModule.psm1'

# Version number of this module.
ModuleVersion = '1.9.4.0'
ModuleVersion = '1.9.5.0'

# Supported PSEditionsls

Expand Down
17 changes: 5 additions & 12 deletions Vasp2Visual/Version2/GeneralFunctions.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,15 @@ function Get-POSCAR {
$var_dict = $var_dict.Replace(")", $rep)
}
Write-Host "Use Pivotpy in Python for full functionality!" -ForegroundColor Yellow
$py_str = "vd = {1}`nfrom pivotpy.api import download_structure`ngp = download_structure('{0}',**vd).poscars`n" -f $Formula, $var_dict
$py_str += "import json`ns=json.dumps([{k:v for k,v in _g.to_dict().items() if 'write' not in k} for _g in gp])`nprint(s)"
$py_str = "vd = {1}`nfrom pivotpy.api import download_structure`noutput = download_structure('{0}',**vd)`n" -f $Formula, $var_dict
$py_str += "import json`ns=json.dumps([_g.export_poscar().text_plain for _g in output])`nprint(s)"
Write-Host $py_str
# Run it finally Using Default python on System preferably.
if($null -ne (Get-Command python3* -ErrorAction SilentlyContinue)){
Write-Host ("Running using {0}" -f (python3 -V)) -ForegroundColor Green
$json = $py_str | python3
ConvertFrom-Json $json
}elseif($null -ne (Get-Command python -ErrorAction SilentlyContinue)){
if($null -ne (Get-Command python -ErrorAction SilentlyContinue)){
Write-Host ("Running using {0}" -f (python -V)) -ForegroundColor Green
$json = $py_str | python
ConvertFrom-Json $json
}elseif($null -ne (Get-Command pytnon2* -ErrorAction SilentlyContinue)){
Write-Host ("Required Python >= 3.6, but {0} found, try upgrading Python." -f (python2 -V)) -ForegroundColor Red
$py_str | python | ConvertFrom-Json
}else{
Write-Host "Python Installation not found. Copy code below and run yourself or use '-SavePyFile'." -ForegroundColor Red
Write-Host "Python Installation not found. Copy code below and run yourself with a python executable" -ForegroundColor Red
Write-Host $py_str -ForegroundColor Yellow
}
}
Expand Down
7 changes: 1 addition & 6 deletions Vasp2Visual/Version2/PlotXml.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,9 @@ function New-Figure {
if($PSBoundParameters.ContainsKey('SavePyFile')){$init | Set-Content $SavePyFile}
Write-Host "Running Following Code`n--------------------------`n" $init "`n" -ForegroundColor Cyan
# Run it finally Using Default python on System preferably.
if($null -ne (Get-Command python3* -ErrorAction SilentlyContinue)){
Write-Host ("Running using {0}" -f (python3 -V)) -ForegroundColor Green
$init | python3
}elseif($null -ne (Get-Command python -ErrorAction SilentlyContinue)){
if($null -ne (Get-Command python -ErrorAction SilentlyContinue)){
Write-Host ("Running using {0}" -f (python -V)) -ForegroundColor Green
$init | python
}elseif($null -ne (Get-Command pytnon2* -ErrorAction SilentlyContinue)){
Write-Host ("Required Python >= 3.6, but {0} found, try upgrading Python." -f (python2 -V)) -ForegroundColor Red
}else{
Write-Host "Python Installation not found. Copy code below and run yourself or use '-SavePyFile'." -ForegroundColor Red
Write-Host $init -ForegroundColor Yellow
Expand Down

0 comments on commit e5aaf44

Please sign in to comment.