Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error getPalette() #52

Closed
cschwem2er opened this issue Aug 18, 2016 · 19 comments
Closed

Error getPalette() #52

cschwem2er opened this issue Aug 18, 2016 · 19 comments

Comments

@cschwem2er
Copy link

Hi,

I'm recently getting an error whyn trying to set a scheme:

brewscheme, scheme(set1) allst(set1) allc(5) allsat(80) replace
Directory exists and rebuild option not specified.  No further action
Directory exists and rebuild option not specified.  No further action
do "/tmp/SD29249.000000"

function getPalette() not declared in class brewcolors

Trying to use the scheme results in another error:

 marginsplot, legend(ring(0) position(12) bmargin(large)) title("") ///
  ytitle("Predicted number of Comments") scheme(set1)

option seriesid() not allowed

Do you have an idea what's the problem here? I'm using Stata14 and already tried a fresh install from the project page.

@wbuchanan
Copy link
Owner

Not sure why it is doing that. Could you rerun things but add:

set tracedepth 2
set trace on

Before the command? This would at least help me to figure out where things are breaking.

@cschwem2er
Copy link
Author

cschwem2er commented Aug 19, 2016

Sure, but it is a loooooooooong output ;-)

...
  - tempname scheme1 scheme2 scheme3 scheme4 scheme5
  - loc themeroot `"`c(sysdir_personal)'b/theme/theme"'
  = loc themeroot `"~/ado/personal/b/theme/theme"'
  - loc schemeroot `"`c(sysdir_plus)'/s/scheme"'
  = loc schemeroot `"~/ado/plus//s/scheme"'
  - qui: file open `scheme1' using `"`schemeroot'-`schemename'.scheme"', w replace
  = qui: file open __000000 using `"~/ado/plus//s/scheme-set1.scheme"', w replace
  - qui: file open `scheme2' using `"`schemeroot'-`schemename'_achromatopsia.scheme"', w replace
  = qui: file open __000001 using `"~/ado/plus//s/scheme-set1_achromatopsia.scheme"', w replace
  - qui: file open `scheme3' using `"`schemeroot'-`schemename'_protanopia.scheme"', w replace
  = qui: file open __000002 using `"~/ado/plus//s/scheme-set1_protanopia.scheme"', w replace
  - qui: file open `scheme4' using `"`schemeroot'-`schemename'_deuteranopia.scheme"', w replace
  = qui: file open __000003 using `"~/ado/plus//s/scheme-set1_deuteranopia.scheme"', w replace
  - qui: file open `scheme5' using `"`schemeroot'-`schemename'_tritanopia.scheme"', w replace
  = qui: file open __000004 using `"~/ado/plus//s/scheme-set1_tritanopia.scheme"', w replace
  - loc pcycles = max( `barcolors', `scatcolors', `areacolors', `linecolors', `boxcolors', `dotcolors', `piecolors', `suncolors', `histcolors'
> , `cicolors', `matcolors', `reflcolors', `refmcolors')
  = loc pcycles = max( 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5)
  - qui: mata: recycle(`numsymbols', `pcycles')
  = qui: mata: recycle(1, 5)
  - foreach symb in `sequence' {
  = foreach symb in 1 1 1 1 1 {
  - loc symbolseq `"`symbolseq' "`: word `symb' of `symbols''""'
  = loc symbolseq `" "circle""'
  - }
  - loc symbolseq `"`symbolseq' "`: word `symb' of `symbols''""'
  = loc symbolseq `" "circle" "circle""'
  - }
  - loc symbolseq `"`symbolseq' "`: word `symb' of `symbols''""'
  = loc symbolseq `" "circle" "circle" "circle""'
  - }
  - loc symbolseq `"`symbolseq' "`: word `symb' of `symbols''""'
  = loc symbolseq `" "circle" "circle" "circle" "circle""'
  - }
  - loc symbolseq `"`symbolseq' "`: word `symb' of `symbols''""'
  = loc symbolseq `" "circle" "circle" "circle" "circle" "circle""'
  - }
  - if `"`constart'"' == `"`conend'"' {
  = if `"set1"' == `"set1"' {
  - qui: su pcolor if palette == `"`constart'"'
  = qui: su pcolor if palette == `"set1"'
  - mata: brewc.getPalette(`"`constart'"', `r(min)')
  = mata: brewc.getPalette(`"set1"', 3)
function getPalette() not declared in class brewcolors
    loc constart `: word 1 of `rgbs''
    loc conend `: word 2 of `rgbs''
    }
  ------------------------------------------------------------------------------------------------------------------------- end brewscheme ---
r(3000);

end of do-file

r(3000);

[edited to make it a bit shorter to scroll over]

@wbuchanan
Copy link
Owner

Have you tried rebuilding the Mata library?

libbrewscheme, replace

It's really bizarre that one of the Mata methods would have disappeared, but this is the only thing i can think of at the moment. You could also check to make sure the libbrewscheme Mata library is on the path, but i assume it would have failed much earlier (e.g., when initializing rhe object). I'll try to see if I can replicate things this weekend from my wife's computer.

@cschwem2er
Copy link
Author

Thanks for investigating. Trying your command from above results in another error:

cbtype() already in library

@wbuchanan
Copy link
Owner

That means the library is already there somewhere. How many copies of libbrewscheme.mlib are there on the ADOPATH? If there's more than one, delete both and then run the command from the previous comment to make sure there is only a single copy kf the library on the path.

@cschwem2er
Copy link
Author

cschwem2er commented Aug 19, 2016

Theres only one copy of libbrewscheme.mlib in the path. I deleted it and ran the command again anyway, but this did not help.
Heres another traceplot:

---------------------------------------------------------------------------------------------- begin libbrewscheme ---
- version 13.1
- syntax[, DISplay Locpath REPlace SIze(passthru) ]
- mata: mata clear
- qui: findfile libbrewscheme.mata
- if `"`locpath'"' != "" {
= if `""' != "" {
  qui: do libbrewscheme.mata
  loc dir
  }
- else {
- qui: do `"`r(fn)'"'
= qui: do `"~/ado/plus/l/libbrewscheme.mata"'
- loc dir dir(`"`c(sysdir_plus)'l/"')
= loc dir dir(`"~/ado/plus/l/"')
- }
- qui: mata: mata mlib create libbrewscheme, `replace' `size' `dir'
= qui: mata: mata mlib create libbrewscheme, replace  dir(`"~/ado/plus/l/"')
- qui: mata: mata mlib add libbrewscheme cbtype() Protanopia() Deuteranopia() Tritanopia() colorblind() translateColor
> () brewcolors(), complete
cbtype() already in library

[snipped out the stack trace for the findfile call]

@wbuchanan
Copy link
Owner

Just got Stata licenses for my office so I should be able to check into things a bit more this week since I'll be using it (can test the install on OSX) and will have the people in my office installing it as well (Windows). This way I can at least have some kind of confidence regarding whether or not the install issue you are facing is strictly due to the OS or something else.

@de-barros
Copy link

Just to +1 that I'm experiencing the same problem.

I tried to rerun something from your paper:

brewscheme, scheme(onecolorex1) allsty(ggplot2)

and I get

function getPalette() not declared in class brewcolors

@wbuchanan
Copy link
Owner

@de-barros & @methodds have you run the libbrewscheme command? The getPalette() method is the last method defined in libbrewscheme.mata and is a member of the brewcolors class, so I'm not sure what is going on with things.

@wbuchanan
Copy link
Owner

@methodds & @de-barros I'm not sure what is causing the issue you ran into. I just installed on a work machine and didn't have any issues with either of the examples:

 ado, f(brewscheme)

. net inst brewscheme, from("http://wbuchanan.github.io/brewscheme")
checking brewscheme consistency and verifying not already installed...
installing into /Users/FCPS/Library/Application Support/Stata/ado/plus/...
installation complete.

. brewcolordb, replace
This program needs to clear all data currently in memory. If this is ok hit enter, otherwise enter the letter 'n'
>  and hit enter to exit the program without clearing data from memory.. 
(242 real changes made)

. brewdb, replace
The directory ~/Library/Application Support/Stata/ado/personal/b was successfully created.

. libbrewscheme, replace

. brewscheme, scheme(set1) allst(set1) allc(5) allsat(80) replace
Directory exists and rebuild option not specified.  No further action
The directory ~/Library/Application Support/Stata/ado/plus/s was successfully created.
. brewscheme, scheme(onecolorex1) allsty(ggplot2)


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


. brewscheme, scheme(set1) allst(set1) allc(5) allsat(80) replace
Directory exists and rebuild option not specified.  No further action
Directory exists and rebuild option not specified.  No further action

Can you confirm that you used the same installation commands as I did in this example?

@cschwem2er
Copy link
Author

I reinstalled again using your commands and the problem still remains. I have no idea what's going on :/.

@brad-smith-mequilibrium

I have this same issue, uninstalled and reinstalled. Install seems to be hung up on

. brewcolordb, replace
This program needs to clear all data currently in memory. If this is ok hit enter, otherwise enter the letter 'n' and hit enter to exit the program without clearing data from memory..
.

It appears to just hang there.

@wbuchanan
Copy link
Owner

@rowen0718,

Can you try installing this on your machine? It seems like it might be a Windows specific issue and this is the only way I might be able to replicate this issue. This is basically the program we'll use to standardize some options in the data visualizations.

@rowen0718
Copy link

Installed it and I get an error at the command brewcolordb, replace. Stata returns an error stating that file c:\ado\personal/brewcolors/colordb.dta could not be opened

From: William Buchanan [mailto:notifications@github.com]
Sent: Friday, September 30, 2016 3:08 PM
To: wbuchanan/brewscheme
Cc: Owen, Michael; Mention
Subject: Re: [wbuchanan/brewscheme] Error getPalette() (#52)

@rowen0718https://github.com/rowen0718,

Can you try installing this on your machine? It seems like it might be a Windows specific issue and this is the only way I might be able to replicate this issue. This is basically the program we'll use to standardize some options in the data visualizations.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//issues/52#issuecomment-250827749, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AT8P7TMVl2j9pcZ_dxUUCmnNjNZv4OJ9ks5qvV4kgaJpZM4JnuLL.

@wbuchanan
Copy link
Owner

@rowen0718
Start up Stata and run:

mkdir C:\ado\personal\

Then try running the command again.

@wbuchanan
Copy link
Owner

@methodds & @de-barros I tried to replicate your issue from @rowen0718's desktop yesterday, but was not able to replicate it successfully. I'll continue trying to look into things, but I'm not sure what is leading to the error that you experienced.

@wbuchanan
Copy link
Owner

@brad-smith-mequilibrium did you hit enter and/or enter 'n' after that prompt on the screen? Depending on the speed of your computer/internet connection that command could take a while to execute since it is retrieving and parsing some files from the internet. In either case, it would probably be best to start a different issue for that if you did have a problem with it since it is not related to the issue in this thread.

@wbuchanan wbuchanan added the bug label Nov 9, 2016
wbuchanan added a commit that referenced this issue Nov 9, 2016
…bugs identified in issue #53 and might help with some of the other path issues that might be behind issue #52
@wbuchanan
Copy link
Owner

@brad-smith-mequilibrium I found the issue that you ran into and will try to patch that quickly today if I have time. As for the other issues on the page I just tested from a Windows based machine and it seems to be running without a problem.

@wbuchanan
Copy link
Owner

@brad-smith-mequilibrium, @de-barros, & @methods,

The errors you listed before should be fixed now. I just pushed a few changes up to the project page today and would definitely appreciate it if you could check to see if this takes care of things for you:

. ado, find(brewscheme)

. net inst brewscheme, from("http://wbuchanan.github.io/brewscheme/") force replace
checking brewscheme consistency and verifying not already installed...

the following files will be replaced:
    c:\ado\plus\jar\brewterpolate.jar
    c:\ado\plus\jar\filesys.jar

installing into c:\ado\plus\...
installation complete.

. brewcolordb, replace
This program needs to clear all data currently in memory. If this is ok hit enter, otherwise enter the letter 'n' and hit enter to exit the program without clearing data from memory.. 
(242 real changes made)

. brewscheme, scheme(set1) allst(set1) allc(5) allsat(80) replace
Directory exists and rebuild option not specified.  No further action


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants