wbuchanan / brewscheme

Stata package for creating user-defined scheme files using research-based color palettes
http://wbuchanan.github.io/brewscheme
27 stars 9 forks source link

Installing into SITE #41

Closed BjarteAAGNES closed 8 years ago

BjarteAAGNES commented 8 years ago

. net set ado SITE

. net inst brewscheme, from("https://wbuchanan.github.io/brewscheme/") replace

. capture noi brewscheme, scheme(set1) allst(set1) allc(5) allsat(80) file H:\Stata\ado\plus/l/libbrewscheme.mata not found

. findfile libbrewscheme.mata R:\STATA\ado\site/l/libbrewscheme.mata

(Stata 14.1 Revision 03 Mar 2016,
java_vmpath R:\STATA\utilities\java\windows-x64\jre1.8.0_31\bin\server\jvm.dll)

wbuchanan commented 8 years ago

Don't use the

net set

Command before installing. The different programs in the package have a lot of internal dependencies on one another that causes them to look in specific locations for the programs (e.g., "c(sysdir_plus)'/l/"' for libbrewscheme.mata). By changing the installation directory it will cause these references to fail. For now try:

ado, find(brewscheme)
ado uninstall [#]
net set ado PLUS

// Then either install from the project page
net inst brewscheme, from("https://wbuchanan.github.io/brewscheme/") replace

// Or you can install the version 1.0 release from the SSC archives
ssc inst brewscheme, replace

Once installed, you'll want to build out the color dataset:

// Creates a data set of the current named color style RGB values and their color sight impaired values
brewcolordb, rep

If that doesn't solve things, then send an update using:

set tracedepth 3
set trace on
...

Where the ... would be the subsequent commands that you try to run. This would show some of what is happening in the programs internally. Do you regularly need to install programs to non-standard locations? If so I can look into ways to make these processes a bit easier/smoother, but it generally doesn't affect too many people from my understanding.

(duplicate/issue related to: https://github.com/wbuchanan/brewscheme/issues/21#issuecomment-172995502)

wbuchanan commented 8 years ago

Received email from @BjarteAAGNES explaining that this is an issue for users who work in a networked environment to make the program available to users more generally.

@BjarteAAGNES since brewtheme, brewscheme, brewcolors, brewdb, and brewcolordb all create files along the \c(sysdir_personal)' path, would you see this as a potential issue? For example, when a theme file is created (or if brewscheme is called without ever having called brewtheme previously)

. ls `"`c(sysdir_personal)'"'
  <dir>   3/28/16 11:23  .                 
  <dir>   3/28/16 11:23  ..                
   0.5k  11/20/00 16:28  inputst.ado       
   0.0k  11/20/00 16:29  inputst.hlp       
   0.3k  11/24/00 17:34  outputst.ado      
   0.0k  11/20/00 16:30  outputst.hlp      
  16.0k   5/16/07 19:52  stado.exe         
   0.2k   2/26/16 17:08  stcmd.ado         
   3.1k  11/25/00 16:56  stcmd.hlp         
 764.0k   3/01/16 16:09  strutils.jar   

. net inst brewscheme, from("https://wbuchanan.github.io/brewscheme/") replace
checking brewscheme consistency and verifying not already installed...
installing into c:\ado\plus\...
installation complete.

. brewcolordb, rep over
(142 real changes made)

. brewdb, rep
The directory c:\ado\personal/b was successfully created.

. ls `"`c(sysdir_personal)'"'
  <dir>   3/28/16 11:43  .                 
  <dir>   3/28/16 11:43  ..                
  <dir>   3/28/16 11:43  b                 
  <dir>   3/28/16 11:43  brewcolors        
  <dir>   3/28/16 11:43  brewuser          
   0.5k  11/20/00 16:28  inputst.ado       
   0.0k  11/20/00 16:29  inputst.hlp       
   0.3k  11/24/00 17:34  outputst.ado      
   0.0k  11/20/00 16:30  outputst.hlp      
  16.0k   5/16/07 19:52  stado.exe         
   0.2k   2/26/16 17:08  stcmd.ado         
   3.1k  11/25/00 16:56  stcmd.hlp         
 764.0k   3/01/16 16:09  strutils.jar      
  <dir>   3/28/16 11:43  style             

. brewscheme, scheme(set1) allst(set1) allc(8) allsat(80)

For bugs/issues, please submit issues to: 
http://github.com/wbuchanan/brewscheme
For additional information about the program visit: 
http://wbuchanan.github.io/brewscheme

So, there are several subdirectories that get created along the ADOPATH and I'm not sure how else I could code a consistent cross-platform location for these subdirectories (and files in some cases). Definitely open to any thoughts/suggestions you may have since I hadn't thought about and/or considered a networked environment and/or the implications it might have (in particular if the metadata are all stored in a networked location what would happen if one user modified a file, etc...).

wbuchanan commented 8 years ago

@BjarteAAGNES provided an example of what the ADOPATH looks like in a networked environment where SITE is being used :

Better example, where S: is a network drive:

SITE will be common to all users and is earlier in ado-path than PLUS:

. sysdir
   STATA:  S:\Prog64\STATA\Stata14MP\
    BASE:  S:\Prog64\STATA\Stata14MP\ado\base\
    SITE:  S:\Prog64\STATA\Stata14MP\ado\site\
    PLUS:  H:\Stata\ado\plus\
PERSONAL:  H:\Stata\ado\personal\
OLDPLACE:  H:\Stata\ado\oldplace\

. adopath
  [1]  (BASE)      "S:\Prog64\STATA\Stata14MP\ado\base/"
  [2]  (SITE)      "S:\Prog64\STATA\Stata14MP\ado\site/"
  [3]              "."
  [4]  (PERSONAL)  "H:\Stata\ado\personal/"
  [5]  (PLUS)      "H:\Stata\ado\plus/"
  [6]  (OLDPLACE)  "H:\Stata\ado\oldplace/"

Modified search locations for Mata library to look across the ADOPATH. Should identify the SITE location first and use the file there if needed. The rest of the programs continue to look and build on the PERSONAL and PLUS ADOPATHs (e.g., brewcolors, brewcolordb, brewdb, brewscheme, and brewtheme) where it would be more important for the end user to be able to modify file contents (e.g., adding new colors, palettes, etc...) without affecting other users. The potential patch is located on the installPath branch. Also connected with @BjarteAAGNES about helping to test the fix/installation/use in a networked environment to make it easier for the program to be used in these types of environments.

wbuchanan commented 8 years ago

Fixed installation issue in https://github.com/wbuchanan/brewscheme/commit/655735800be1e358d8d689720a25925645bbd3d8