Giter VIP home page Giter VIP logo

Comments (5)

polyluxus avatar polyluxus commented on June 9, 2024

Prepare will now filter the route section for a comment before applying it (at least currently for the -R/-l switches.

$ g16.prepare.dev -llist
INFO    : Configuration file '<HOME>/devel/tools-for-g16.bash/.g16.toolsrc' applied.
    0 : # PM6

    1 : #P B97D3/def2SVP/W06   DenFit

    2 : #P B97D3/def2TZVPP/W06 DenFit

    3 : #P PBE1PBE/def2SVP ! this is known as pbe0
$ g16.prepare.dev -l3 -ropt -jtest start.xyz
INFO    : Configuration file '<HOME>/devel/tools-for-g16.bash/.g16.toolsrc' applied.
INFO    : Removed comment: this is known as pbe0
INFO    : Applied route section:
INFO    : #P PBE1PBE/def2SVP
INFO    : Added 'opt' to the route section.
INFO    : Setting charge (0) and multiplicity (1).
INFO    : Using caption 'Calculation: test; chrg 0; mult 1; uhf 0; 2019-04-16 20:53:28 (CEST)'.
INFO    : Checkpoint file 'test.chk' does not exists and will be created.
INFO    : Added 'MaxDisk=30000MB' to the route section.
INFO    : Written modified inputfile 'test.com'.
INFO    : g16.prepare.sh is part of tools-for-g16.bash 0.3.0.dev (2019-04-XX)
$ head -n5 test.com
%Chk=test.chk
%NProcShared=12
%Mem=4000MB
#P PBE1PBE/def2SVP opt MaxDisk=30000MB

This allows the following in the .g16.toolsrc:

# Predefined Route sections
  g16_route_section_default="#P B97D3/def2SVP/W06   DenFit"
  g16_route_section_predefined[0]="# PM6"
  g16_route_section_predefined[1]="#P B97D3/def2SVP/W06   DenFit"
  g16_route_section_predefined[2]="#P B97D3/def2TZVPP/W06 DenFit"
  g16_route_section_predefined[3]="#P PBE1PBE/def2SVP ! this is known as pbe0"
#

What remains now is building this section ...


Note though:

$ g16.prepare.dev -R'#P PBE1PBE/def2SVP ! this is known as pbe0' -ropt -jtest start.xyz
INFO    : Configuration file '<HOME>/devel/tools-for-g16.bash/.g16.toolsrc' applied.
INFO    : Removed comment: this is known as pbe0
INFO    : Route section has no syntax errors.
INFO    : Applied route section:
INFO    : #P PBE1PBE/def2SVP
INFO    : Added 'opt' to the route section.
INFO    : Setting charge (0) and multiplicity (1).
INFO    : Using caption 'Calculation: test; chrg 0; mult 1; uhf 0; 2019-04-16 20:57:53 (CEST)'.
INFO    : Checkpoint file 'test.chk' does not exists and will be created.
INFO    : Added 'MaxDisk=30000MB' to the route section.
INFO    : Written modified inputfile 'test.com'.
INFO    : g16.prepare.sh is part of tools-for-g16.bash 0.3.0.dev (2019-04-XX)
$ tail -n3 test.com

!Automagically created with g16.prepare.sh (tools-for-g16.bash, 0.3.0.dev, 2019-04-XX)
!'<HOME>/bin/g16.prepare.dev' '-R#P PBE1PBE/def2SVP ! this is known as pbe0' '-ropt' '-jtest' 'start.xyz'

The comment will still be saved.

from tools-for-g16.bash.

O2-AC avatar O2-AC commented on June 9, 2024

Not sure if that is overcomplicating the problem, but instead of saving the comment to a predefined route section in that variable itself, one could think about a new variable g16_route_section_predefined_comment[n] with n corresponding to the respective g16_route_section_predefined[n].

In that case only the output of g16.prepare -l list would need to be changed to concatenate the respective comment to the predefined route section. All the other scripts could stay as they are. This would also allow for a nicer formatting with line breaks in the output of g16.prepare -l list.

from tools-for-g16.bash.

polyluxus avatar polyluxus commented on June 9, 2024

Not sure if that is overcomplicating the problem, but instead of saving the comment to a predefined route section in that variable itself, one could think about a new variable g16_route_section_predefined_comment[n] with n corresponding to the respective g16_route_section_predefined[n].

That is now part of the prepare script, but still needs a lot of manual labour.

$ g16.prepare.dev -llist
INFO    : Configuration file '<HOME>/devel/tools-for-g16.bash/g16.tools.rc' applied.
  0       : # PM6
  0(cmt.) : semi-empirical method (default route)

  1       : #P B97D3/def2SVP/W06                            DenFit
  1(cmt.) : pure DFT method with density-fitting, double zeta BS (default route)

  2       : #P B97D3/def2TZVPP/W06                          DenFit
  2(cmt.) : pure DFT method with density-fitting, triple zeta BS (default route)

  3       : #P BP86/def2SVP/W06   EmpiricalDispersion=GD3BJ DenFit
  3(cmt.) : pure DFT method with density-fitting and DFT-D3 with Becke-Johnson damping,
  3(cmt.) : double zeta BS (default route)

  4       : #P BP86/def2TZVPP/W06 EmpiricalDispersion=GD3BJ DenFit
  4(cmt.) : pure DFT method with density-fitting and DFT-D3 with Becke-Johnson damping,
  4(cmt.) : triple zeta BS (default route)

  5       : #P PBE1PBE/def2SVP    EmpiricalDispersion=GD3BJ
  5(cmt.) : hybrid DFT method with DFT-D3 with Becke-Johnson damping, double zeta BS
  5(cmt.) : (default route)

  6       : #P PBE1PBE/def2TZVPP  EmpiricalDispersion=GD3BJ
  6(cmt.) : hybrid DFT method with DFT-D3 with Becke-Johnson damping, triple zeta BS
  6(cmt.) : (default route)

  7       : #P B3LYP/def2SVP      EmpiricalDispersion=GD3BJ
  7(cmt.) : hybrid DFT method with DFT-D3 with Becke-Johnson damping, double zeta BS
  7(cmt.) : (default route)

  8       : #P B3LYP/def2TZVPP    EmpiricalDispersion=GD3BJ
  8(cmt.) : hybrid DFT method with DFT-D3 with Becke-Johnson damping, triple zeta BS
  8(cmt.) : (default route)

from tools-for-g16.bash.

polyluxus avatar polyluxus commented on June 9, 2024

I think for the most part this is working now:

path/to/configure.sh -R

will load the configuration file in the same behaviour as the main scripts, then will jump to the route builder, which will cause the routebuilder.sh script to be loaded. (Yes, I know that is a bit complicated, but I did not see how to prevent this. routebuilder.sh has very limited utility as a standalone script.)
Finally, it will replace the found configuration file (maintaining a backup as usual).

What is missing so far is, that entered route sections will be checked, but I need to think about how to return to the editor window, if there are syntax errors, including the actual error so that the user gets a hint where it failed.

from tools-for-g16.bash.

polyluxus avatar polyluxus commented on June 9, 2024

What is missing so far is, that entered route sections will be checked, but I need to think about how to return to the editor window, if there are syntax errors, including the actual error so that the user gets a hint where it failed.

This should now work in some fashion. It will not take you back to the edit screen, but if an error is detected, it will amend the comment with a warning.

$ ./routebuilder.sh 
INFO    : Configuration file '<HOME>/devel/tools-for-g16.bash/configure/.g16.toolsrc' applied.
  0       : # PM6                                                                           
  0(cmt.) : semi-empirical method (default route)                                           

  1       : #P B97D3/def2SVP/W06 DenFit                                                     
  1(cmt.) : pure DFT method with dens. fitting and with DFT-D3 (Becke-Johnson damping),     
  1(cmt.) : double zeta BS                                                                  

  2       : #P B97D3/def2TZVPP/W06 DenFit                                                   
  2(cmt.) : pure DFT method with dens. fitting and with DFT-D3 (Becke-Johnson damping),     
  2(cmt.) : triple zeta BS                                                                  
INFO    : Which route section would you like to edit?
INFO    : To create a new route section pick an unused number.
INFO    : To delete a route section suffix/append 'd' to its index number.
INFO    : Enter 's' save the manipulated data to '/tmp/tmp.kgCpJfsUqm'.
INFO    : Please enter an integer value or 'q' to quit.
ANSWER  : 0
This feature is not yet fully implemented.
WARNING : There was an error in the route section
INFO    : Loading CHEMISTRY environment                                                                                                                                                  [ OK ]
INFO    : Loading gaussian/16.b01_bin                                                                                                                                                    [ OK ]
INFO    : (External Revision) ES64L-G16RevB.01 20-Dec-2017 NErtGn=2000 NextEG=1161 MaxAtm=250000 MDCach=131072
INFO    : -------
INFO    : # PM666
INFO    : -------
INFO    : QPErr --- A syntax error was detected in the input line.
INFO    : # PM666
INFO    : '
INFO    : Last state= "GCL"
INFO    : TCursr=      3939 LCursr=         2
INFO    : Error termination via Lnk1e at Sat May 18 18:02:45 2019.
  0       : # PM666                                                                         
  0(cmt.) : (WARNING: Syntax error detected.)  semi-empirical method (devil route)          

  1       : #P B97D3/def2SVP/W06 DenFit                                                     
  1(cmt.) : pure DFT method with dens. fitting and with DFT-D3 (Becke-Johnson damping),     
  1(cmt.) : double zeta BS                                                                  

  2       : #P B97D3/def2TZVPP/W06 DenFit                                                   
  2(cmt.) : pure DFT method with dens. fitting and with DFT-D3 (Becke-Johnson damping),     
  2(cmt.) : triple zeta BS                                                                  
INFO    : Which route section would you like to edit?
INFO    : To create a new route section pick an unused number.
INFO    : To delete a route section suffix/append 'd' to its index number.
INFO    : Enter 's' save the manipulated data to '/tmp/tmp.kgCpJfsUqm'.
INFO    : Please enter an integer value or 'q' to quit.
ANSWER  : q

from tools-for-g16.bash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.