SPARKYHOME variable

193 views
Skip to first unread message

Jessica Gonzalez Delgado

unread,
Feb 10, 2020, 7:18:59 PM2/10/20
to NMR SPARKY USER GROUP
Hey!

I just upgraded to the 1/29/2020 build and the SPARKYHOME environment variable is not being read by Sparky. It has worked with no issues in the previous versions. I have tried deleting it, restarting, and setting it up again but nothing. Just wanted to let you know about that bug. 

Best,
Jessica

Woonghee Lee

unread,
Feb 10, 2020, 7:23:01 PM2/10/20
to NMR SPARKY USER GROUP
Hi Jessica,

That is not a bug. You should set SPARKYHOME using "RD". No longer sparkyhome.cfg is used. You have .sparky.cfg file that will contain other configurations as well. There are more customizeable things and I would choose to use a universal configuration file rather than making all different setting files.

Best,
Woonghee

Jun Yang

unread,
Jun 8, 2021, 1:06:09 PM6/8/21
to NMR POKY/SPARKY USER GROUP
Hi Woonghee,

In sparky 3.115, it will create a folder of "Sparky" that includes three subfolders "Lists", "Save", and "Projects" for each project, then we set "SPARKYHOME" to be "./" so that if we browse to folder "Sparky" and then run sparky, this will automatically load proper file from the three subfolders. However, this doesn't work for NMRFAM-SPARKY. No matter I'm in folder "Sparky" or the folder one level up, when I run nmrfam-sparky, it always pops the message of not finding the "Sparky" and three subfolders "Lists", "Save", and "Projects", even they are already there. Even I use "RD" to change to "/home/user/project1/Sparky", the pop-up message of not finding the "Sparky" and three subfolders will still shows no matter if I'm in "/home/user/project1" or "/home/user/project1/Sparky". What's worse is that because SPARKHOME is now absolute path, I have to change it every time I'm looking at different project. Therefore, my questions are:
1. How to set it up so that the pop-up message won't show if the folder "Sparky" and three subfolders are already existed?
2. Can we set SPARKYHOME to be "./"?

Thanks.

Jun

Lee, Woonghee

unread,
Jun 8, 2021, 1:11:26 PM6/8/21
to Jun Yang, NMR POKY/SPARKY USER GROUP

Jun,

 

1. .sparky.cfg file in your home directory is more prioritized than you set the environment variable SPARKYHOME. You can simply check if that is correctly placed and set. Also, those three subfolder problem is somewhat related to #2.

2. It doesn’t always work but you can.

 

If navigating folders is the thing that wastes your time, you can consider Poky because it supports drag’n drop.

 

Best,

Woonghee

 

 

--

Woonghee Lee, I.E.I.P., M.S., Ph.D.

 

Assistant Professor

Department of Chemistry

University of Colorado Denver

1151 Arapahoe St. (Science Bldg.) Rm 4128A

Denver, CO 80217-3364, USA

Office: +1-303-315-7672

woongh...@ucdenver.edu

 

https://poky.clas.ucdenver.edu

https://poky.clas.ucdenver.edu/wlee-group

https://clas.ucdenver.edu/chemistry/woonghee-lee

 

Shipping/Mailing Address:

Woonghee Lee

1201 5th St. UCD CHEM-194

P.O. Box 173364 (USPS)

Denver, CO 80204, USA

--
You received this message because you are subscribed to the Google Groups "NMR POKY/SPARKY USER GROUP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nmr-sparky+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nmr-sparky/c8dec4eb-d422-4815-abba-7a0636b85015n%40googlegroups.com.

Jun Yang

unread,
Jun 8, 2021, 1:24:58 PM6/8/21
to NMR POKY/SPARKY USER GROUP
When I edit .sparky.cfg and set SPARKYHOME to be "./", now I don't have to rename SPARKHOME for every different project. So my only concern is the pop-up message of not finding the folder "Sparky" etc. even they are already existed. Any idea how to fix that?

Lee, Woonghee

unread,
Jun 8, 2021, 1:27:19 PM6/8/21
to Jun Yang, NMR POKY/SPARKY USER GROUP

Dear Jun,

 

I don’t have any plan to fix it in NMRFAM-SPARKY. If fixed, it will be POKY.

Jun Yang

unread,
Jun 8, 2021, 1:31:03 PM6/8/21
to NMR POKY/SPARKY USER GROUP

I solved the problem, the reason is because now nmrfam-sparky will create a fourth default folder named "Spectra". Only when all four folders are present, the pop-up message will disappear. By the way, what is the folder "Spectra" for?

Lee, Woonghee

unread,
Jun 8, 2021, 1:33:12 PM6/8/21
to Jun Yang, NMR POKY/SPARKY USER GROUP

You can have ucsf files there. But you can still use your preferred directory if you don’t want to stick with it. Basically, I wish users to use different directories for raw files and save files.  

Jun Yang

unread,
Jun 8, 2021, 1:59:53 PM6/8/21
to NMR POKY/SPARKY USER GROUP
I see. Thanks. By the way, if I modify a python script, do I need to close sparky and re-open it to see the effect? Also how to incorporate my own python script, just copy it in folder "<NMRFAM-SPARKY>/python/sparky" ?

Lee, Woonghee

unread,
Jun 8, 2021, 2:01:41 PM6/8/21
to Jun Yang, NMR POKY/SPARKY USER GROUP

Yes, you have to close and rerun. You can place the modified version in /python/sparky.

Jun Yang

unread,
Jun 8, 2021, 2:07:04 PM6/8/21
to NMR POKY/SPARKY USER GROUP
What about my own python script? copy it to /python/sparky?

Lee, Woonghee

unread,
Jun 8, 2021, 2:11:31 PM6/8/21
to Jun Yang, NMR POKY/SPARKY USER GROUP

There are a few ways but the most intuitive way would be to click “Load Module…” button in the Python shell “py”.

Let say if your function “functionA” in the module “moduleB” accepts one argument which is the session instance.

  1. Load the python module “moduleB” by clicking Load Module… button.
  2. Type “module.functionA(s)” in the shell (s is the session instance).

 

That will do.

Jun Yang

unread,
Jun 8, 2021, 2:57:55 PM6/8/21
to NMR POKY/SPARKY USER GROUP
Is there a way to automatically load my own python scripts, like all the extensions in /python/sparky/?

Lee, Woonghee

unread,
Jun 8, 2021, 3:30:45 PM6/8/21
to Jun Yang, NMR POKY/SPARKY USER GROUP

Session has a function called “add_command”

In the sparky_init.py’s initialize_session function, you can add like this:

Session.add_command(two letter code, menu text, function)

 

I am sorry I need to focus on my work from now. Replies will be slow.

Jun Yang

unread,
Jun 8, 2021, 5:33:37 PM6/8/21
to NMR POKY/SPARKY USER GROUP
Thanks for the wonderful work of NMRFAM-Sparky!
Reply all
Reply to author
Forward
0 new messages