comp426-2022-fall / a02

Create a command line Node.js package that ingests API data from Open-Meteo
GNU Affero General Public License v3.0
0 stars 0 forks source link

Clarification needed: I'm unsure of what "galosh.js -j" needs to return. #11

Closed jorbea closed 1 year ago

jorbea commented 1 year ago

I've checked galo.sh to try and get an idea of what exactly needs to be returned when entering the command "galosh.js -j" into our app, but what I have tried thus far is not satisfying the autograder.

Here is what I've tried:

  1. Return a message to ask the user to enter a lat and long.
  2. Return the weather data from open-meteo. If the lat and long are specified, return that weather data. If not, return a message to ask the user to enter a lat and long.
  3. Return the weather data from open-meteo. If the lat and long are specified, return that weather data. If not, return a default of lat 35/long 79 weather data.
  4. Return the weather data from open-meteo. If the lat and long are specified, return that weather data. If not, return a default of lat 35/long 79 weather data. Added "Pretty" format and adjusted the output to include only the keys from the example open-meteo JSON output under "Find the appropriate request URL".

*My current weather JSON includes the following information when provided a lat of 35 and long of 79: { "latitude": 35, "longitude": 79, "generationtime_ms": 0.35202503204345703, "utc_offset_seconds": -14400, "timezone": "America/New_York", "timezone_abbreviation": "EDT", "elevation": 5507, "current_weather": { "temperature": -17.7, "windspeed": 8, "winddirection": 306, "weathercode": 0, "time": "2022-10-13T20:00" }, "daily_units": { "time": "iso8601", "precipitation_hours": "h" }, "daily": { "time": [ "2022-10-13", "2022-10-14", "2022-10-15", "2022-10-16", "2022-10-17", "2022-10-18", "2022-10-19" ], "precipitation_hours": [ 3, 0, 0, 0, 0, 0, 0 ] } }

Any clarification would be much appreciated!

smelliskay commented 1 year ago

Handling -j (args.j) just means logging your data from response.json() and then doing process.exit(0). Sorry if this was unclear from the assignment instructions.

jorbea commented 1 year ago

Hi Ellis,

Thank you for your help a few weeks ago trying to debug my assignment. I tinkered around with a few things to try and figure out what changed from before we looked into it and after, since it went from failing one test (galosh.js JSON) to failing three (Today weather, galosh.js today, and still galosh.js JSON). After looking through my commits, I realized that I didn't change anything, but I think what the autograder was testing changed. I reverted to an older commit that was passing everything but the galosh.js JSON, and now it's failing the same three tests.

Unfortunately, I didn't take note of the type of change that you recommended for the days/precipitation if statements, so I was wondering if you have any advice as to what I should try/what I'm missing that is resulting in those three tests failing. When I test them, the output appears correct.

Thank you for your time!

vennila-t commented 1 year ago

Looks like you were able to figure out the issue! Yes, occasionally you will have everything correct but the autograder will expect certain syntax with output (INCLUDING exact spacing) so keep that in mind when moving forward in the assignments.