Open gyachdav opened 7 years ago
@gyachdav - Hello, the pokemon sightings from the API(that are fetched from the db) do not include the predictions.
Yes, because they should be generated on the fly :)
I guess once you can run the predictions, aka call the right function, and get an output, it will be pretty straightforward to implement the route.. Although: you could already implement the route, and imagine to have some magic predictShit(lat, lng, timestamp)
function that returns the predictions and you later expose this to a GET request :)
Btw. predictions for predict(lat, lng, timestamp)
will be available as an array of the following objects:
{"pokemonId":"16","confidence":"0.242","latitude":11.6088567,"longitude":48.1679286}
Refer #187 . Changes will need to be made after the predictions are made available later.
referencing https://github.com/PokemonGoers/PredictPokemon-2/issues/67 again since I did not get any answer so far.
According to @Aurel-Roci the integration of predictions into this project is complete. On the demo app I do not see any prediction.
What is the status then? Is there a demo URL that will show that this integration is really done?
@PokemonGoers/pokedata @PokemonGoers/predictpokemon-2
@sacdallago please make sure this is handled in the next 24 hours thanks
Guys, can you give us an endpoint? :)
The function is mentioned in the comments above: function: predict(lat, lng, timestamp) response : {"pokemonId":"16","confidence":"0.242","latitude":11.6088567,"longitude":48.1679286}
@Aurel-Roci - And how are we supposed to include your project? Is it available as an npm package?
@vivek-sethia Yes it is available as a package, I mentioned that in the issue with adding the java in the docker container. I thought this was already known by you guys since @jonas-he mentioned the package.
@Aurel-Roci - seems like some miscommunication. Will integrate the package and commit in a while.
@Aurel-Roci - I am trying to integrate and get the following error about the file prediction_feature_config.json
.
Is there something that needs to be done additionally?
2016-10-28T18:05:13.742Z started prediction script, init DC
fs.js:634
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open 'prediction_feature_config.json'
at Error (native)
at Object.fs.openSync (fs.js:634:18)
at Object.fs.readFileSync (fs.js:502:33)
at fileToJson (PokeData/node_modules/predict-pokemon/dataSet_creator.js:364:23)
at Object.DC.init (PokeData/node_modules/predict-pokemon/dataSet_creator.js:30:22)
at PokeData/node_modules/predict-pokemon/prediction.js:31:8
at Object.<anonymous> (PokeData/node_modules/predict-pokemon/prediction.js:241:3)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
at Function.Module._load (module.js:407:3)
@vivek-sethia Yeah, sorry forgot to tell you that you have to unzip json/pokestop_groups.7z
file in the prediction npm package location. It will take some time to initialize the module. Let me know if it works
@Aurel-Roci - I already extracted it after referring to https://github.com/PokemonGoers/PredictPokemon-2/issues/67#issuecomment-254126234.
And still got this error, so wanted to know if there is anything else?
@vivek-sethia I cant seem to reproduce that error. The only thing that comes to my mind is to add /
before the file name /prediction_feature_config.json
, like so.
@Aurel-Roci - Where exactly am I supposed to make this change ?
@vivek-sethia in node_modules/predict-pokemon/prediction.js. Line 31
@Aurel-Roci - Doesn't work.
Well, do I have to copy the extracted pokestop_groups.json
to some other location?
@vivek-sethia from what I see from the stacktrace the problem is with prediction_feature_config.json
. For some reason it cannot find it, which I dont understand
@Aurel-Roci - Exactly, I already verified that the prediction_feature_config.json
file exists at the expected location.
I have committed the change. Maybe you could check once if there is something missing.
@vivek-sethia the require('predict-pokemon')
, should be require('predict-pokemon').predictor
.
@Aurel-Roci - Already tried that too. Same error as above.
@Aurel-Roci - Maybe you could try the code yourself and see it it works.
@vivek-sethia I guess we found an error, stay tuned, we try to solve it.
@vivek-sethia Thanks to @semioniy, this is what we found, first what has to be done is move the content of the predict-pokemon package from Project/node_modules/predict-pokemon directly into the project directory. For some reason the paths do not seem to work correctly in the package. Also change the tzwhere like described here https://www.npmjs.com/package/predict-pokemon
@Aurel-Roci Can you please make this change and test it yourself? Seems to be much easier that way. You can amend my commit if needed.
@vivek-sethia @semioniy already tested it and it works
@Aurel-Roci @semioniy Can I then merge my commit ?
@vivek-sethia did you move the contents of the package directly to the project?
@Aurel-Roci - You mean in the commit? No, because we don't push the node_modules.
@sacdallago can you help us with this problem. When the prediction package is published the paths seem not work properly. What is the cause of that?
@Aurel-Roci - Also, have you tested by including your npm package as a dependency in another project?
@vivek-sethia that's what I did to test. It works after moving files to parent-parent directory, unzipping zip-files and changing tzwhere dependence. From a box it doesn't work.
@sacdallago - What do you suggest? Should we commit the entire predict-pokemon
package in this repo too?
@sacdallago , @gyachdav - Any inputs on this?
Sorry guys I'm currently on a conference. I'll be able to give you valuable input tomorrow!
@sacdallago just reminding you that you wanted to give input
Thanks @jonas-he for reminding, sorry about that. Looks like a relative path problem, to me.
@semioniy @Aurel-Roci I've noticed a whole bunch of no-no's in your code:
init()
options.__dirname
through path
. More at: http://stackoverflow.com/questions/8131344/what-is-the-difference-between-dirname-and-in-node-jspath
chain https://github.com/PokemonGoers/PredictPokemon-2/blob/develop/prediction.js#L31@Aurel-Roci , @semioniy , @sacdallago - Once the issues are fixed, we could merge #194 and then close this issue.
@vivek-sethia The new package is released, you can install it and try it out. And let me now if it works
@sacdallago @semioniy @Aurel-Roci - Lots of errors after installing the new package and extracting the
json/pokestop_groups.7z
file.
Some of the initial errors are below.
prediction.js
, File prediction_feature_config.json
could not be found on line 41. This is because of a missing /
before the file name.dataSet_creator.js
on line 31.terrain_features.js
on line 6. This time, the file actually does not exist at the specified path but at a totally different location in resources
.Since the integration is already done in our project, I would suggest, that you fix all these issues and just change the package version in package.json
of our project, test it and push it.
@Aurel-Roci @semioniy please fix this ASAP
@vivek-sethia Now the package is working. Needs to be checked again when the API is up, but it should work then too
Mh @jonas-he can you check that this really is the case? If so, I will trigger a new docker deployment which will contain the update package
@Aurel-Roci - It now refers to the latest version 0.1.6
Still not working:
[pokedatadevelop-1]2016-11-07T10:16:17.644914864Z npm info it worked if it ends with ok
[pokedatadevelop-1]2016-11-07T10:16:17.645389310Z npm info using npm@2.14.2
[pokedatadevelop-1]2016-11-07T10:16:17.645692252Z npm info using node@v4.0.0
[pokedatadevelop-1]2016-11-07T10:16:19.096545617Z npm info prestart pokemongo-api@0.0.1
[pokedatadevelop-1]2016-11-07T10:16:19.162998917Z npm info start pokemongo-api@0.0.1
[pokedatadevelop-1]2016-11-07T10:16:19.170461598Z
[pokedatadevelop-1]2016-11-07T10:16:19.170491476Z > pokemongo-api@0.0.1 start /usr/src/app
[pokedatadevelop-1]2016-11-07T10:16:19.170497735Z > NODE_ENV=production node app.js
[pokedatadevelop-1]2016-11-07T10:16:19.170502501Z
[pokedatadevelop-1]2016-11-07T10:16:29.305042849Z 2016-11-07T10:16:29.271Z started prediction script, init DC
[pokedatadevelop-1]2016-11-07T10:16:51.054250201Z fs.js:549
[pokedatadevelop-1]2016-11-07T10:16:51.054310117Z return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
[pokedatadevelop-1]2016-11-07T10:16:51.054321872Z ^
[pokedatadevelop-1]2016-11-07T10:16:51.054327505Z
[pokedatadevelop-1]2016-11-07T10:16:51.054332621Z Error: ENOENT: no such file or directory, open '/usr/src/app/node_modules/predict-pokemon/feature_sources/../json/pokestop_groups.json'
[pokedatadevelop-1]2016-11-07T10:16:51.054338077Z at Error (native)
[pokedatadevelop-1]2016-11-07T10:16:51.054343085Z at Object.fs.openSync (fs.js:549:18)
[pokedatadevelop-1]2016-11-07T10:16:51.054347806Z at Object.fs.readFileSync (fs.js:397:15)
[pokedatadevelop-1]2016-11-07T10:16:51.054352990Z at fileToJson (/usr/src/app/node_modules/predict-pokemon/feature_sources/place_features.js:139:23)
[pokedatadevelop-1]2016-11-07T10:16:51.054358426Z at /usr/src/app/node_modules/predict-pokemon/feature_sources/place_features.js:7:26
[pokedatadevelop-1]2016-11-07T10:16:51.054363620Z at Object.<anonymous> (/usr/src/app/node_modules/predict-pokemon/feature_sources/place_features.js:142:3)
[pokedatadevelop-1]2016-11-07T10:16:51.054369031Z at Module._compile (module.js:434:26)
[pokedatadevelop-1]2016-11-07T10:16:51.054373923Z at Object.Module._extensions..js (module.js:452:10)
[pokedatadevelop-1]2016-11-07T10:16:51.054380581Z at Module.load (module.js:355:32)
[pokedatadevelop-1]2016-11-07T10:16:51.054385643Z at Function.Module._load (module.js:310:12)
[pokedatadevelop-1]2016-11-07T10:16:51.054390497Z at Module.require (module.js:365:17)
[pokedatadevelop-1]2016-11-07T10:16:51.054395194Z at require (module.js:384:17)
[pokedatadevelop-1]2016-11-07T10:16:51.054399834Z at /usr/src/app/node_modules/predict-pokemon/dataSet_creator.js:52:30
[pokedatadevelop-1]2016-11-07T10:16:51.054465777Z at Array.forEach (native)
[pokedatadevelop-1]2016-11-07T10:16:51.054475841Z at Object.DC.init (/usr/src/app/node_modules/predict-pokemon/dataSet_creator.js:38:32)
[pokedatadevelop-1]2016-11-07T10:16:51.054481277Z at /usr/src/app/node_modules/predict-pokemon/prediction.js:42:8
[pokedatadevelop-1]2016-11-07T10:16:51.339961005Z
[pokedatadevelop-1]2016-11-07T10:16:51.358394394Z npm info pokemongo-api@0.0.1 Failed to exec start script
[pokedatadevelop-1]2016-11-07T10:16:51.359595861Z npm ERR! Linux 4.4.0-42-generic
[pokedatadevelop-1]2016-11-07T10:16:51.360807991Z npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
[pokedatadevelop-1]2016-11-07T10:16:51.361674069Z npm ERR! node v4.0.0
[pokedatadevelop-1]2016-11-07T10:16:51.369809860Z npm ERR! npm v2.14.2
[pokedatadevelop-1]2016-11-07T10:16:51.371324803Z npm ERR! code ELIFECYCLE
[pokedatadevelop-1]2016-11-07T10:16:51.372038133Z npm ERR! pokemongo-api@0.0.1 start: `NODE_ENV=production node app.js`
[pokedatadevelop-1]2016-11-07T10:16:51.372839100Z npm ERR! Exit status 1
[pokedatadevelop-1]2016-11-07T10:16:51.374822582Z npm ERR!
[pokedatadevelop-1]2016-11-07T10:16:51.375998085Z npm ERR! Failed at the pokemongo-api@0.0.1 start script 'NODE_ENV=production node app.js'.
[pokedatadevelop-1]2016-11-07T10:16:51.383628766Z npm ERR! This is most likely a problem with the pokemongo-api package,
[pokedatadevelop-1]2016-11-07T10:16:51.387430954Z npm ERR! not with npm itself.
[pokedatadevelop-1]2016-11-07T10:16:51.391594875Z npm ERR! Tell the author that this fails on your system:
[pokedatadevelop-1]2016-11-07T10:16:51.396719920Z npm ERR! NODE_ENV=production node app.js
[pokedatadevelop-1]2016-11-07T10:16:51.406632817Z npm ERR! You can get their info via:
[pokedatadevelop-1]2016-11-07T10:16:51.410209885Z npm ERR! npm owner ls pokemongo-api
[pokedatadevelop-1]2016-11-07T10:16:51.412017196Z npm ERR! There is likely additional logging output above.
[pokedatadevelop-1]2016-11-07T10:16:51.423986162Z
[pokedatadevelop-1]2016-11-07T10:16:51.435966064Z npm ERR! Please include the following file with any support request:
[pokedatadevelop-1]2016-11-07T10:16:51.447907497Z npm ERR! /usr/src/app/npm-debug.log
@sacdallago - The above file not found error seems to be because the json/pokestop_groups.7z
file is not unzipped.
@Aurel-Roci - Is it possible for you to directly include the pokestop_groups.json
file?
Great. What would life be without this constant predict pokemon struggle x)
Did you by chance not unzip the zips in the data
and json
directory?
/usr/src/app/node_modules/predict-pokemon/feature_sources/../json/pokestop_groups.json
Is at least zipped if you just checked the package out.
@bensLine - node_modules
folder is not pushed to the repository. The packages are installed using the commands in the Dockerfile. (npm install
).
Hello there pokedata, it has been a while 😆
I didn't see any spec in your API that will allow the map team to retrieve predictions. Are predictions included in the sighting data? is there a parameter that distinguish predictions from sightings?
Same questions apply to the model that holds prediction data.
Please respond ASAP.