Hello,
I’m creating a package that will perform table lookups on some standardized chemical tables one can find online, and I’d like to inquire as to best practices for where and how to look for these resources once downloaded.
The current workflow will be:
- User finds table (one for hydrogen, one for nitrogen, etc) online they like want to work with, and they download it into a location of their choice. Perhaps eventually I’ll migrate this step within the package itself.
- User imports my package
- User sets path to the library of various tables they have downloaded
- User calls function from my package, and it grabs the table requested from the path where the user is storing these tables
Example usage:
using MyPackage
libpath = "/home/user/chemtables/"
value = MyPackage.hf("H2O",298.15)
println("The enthalpy of formation of water at 298.15K is: $value")
I’d rather not always have the path as an input to the function that will access the table. This seems to suggest that my only option is to be playing with global variables, and have a reserved variable name that the package always accesses for the user-defined path (which I suppose would always be needed at the top of the script, or maybe have a backup default location if it can’t find it). Is there a better way to approach this?
Edit: for those bothered by inputting a temperature for a formation enthalpy, forgive me, I was thinking sensible enthalpy at the time.