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

Investigate method for looking up weather station data #20

Closed
jkwan2011 opened this issue Jun 14, 2023 · 4 comments · Fixed by #82
Closed

Investigate method for looking up weather station data #20

jkwan2011 opened this issue Jun 14, 2023 · 4 comments · Fixed by #82
Labels
good first issue Good for newcomers rules-engine Issues related to the Python rules engine

Comments

@jkwan2011
Copy link
Collaborator

We need to look up weather station data for the calculation of heat degree days. There are APIs online (e.g. https://www.degreedays.net) that might be able to help.

  • Obtained from an API (either degree days or visual crossing or some other), and likely called from Javascript
  • How do we get location information? Is it provided by the user?
  • Consider how does this interact with a client-side offline-first app? Instructions to cache data on the device?
  • Consider licensing and pricing model
@alanisaac alanisaac added the rules-engine Issues related to the Python rules engine label Jun 14, 2023
@jkwan2011 jkwan2011 added the good first issue Good for newcomers label Jun 14, 2023
@spghtti
Copy link
Collaborator

spghtti commented Jun 14, 2023

@thadk
Copy link
Member

thadk commented Sep 6, 2023

Use Archive to retrieve archival weather (do not use for last 6-7 days of weather)

@plocket
Copy link
Collaborator

plocket commented Sep 20, 2023

I know we rejected useFetcher, but it might be a better solution than useLoader (because of the complications in getting useLoader to have multiple loaders) if we can use it right. GPT 3.5 has this to say about using useFetcher that may be worth trying (though it says this isn't directly from Remix, so YOMMV):

To use useFetcher to fetch data from an API without using it for a form, you can define a custom fetcher function and pass it to useFetcher. Here's an example:

import { useFetcher } from "@remix-run/react";

const fetchData = async () => {
  const response = await fetch("https://api.example.com/data");
  const data = await response.json();
  return data;
};

export function MyComponent() {
  const fetcher = useFetcher(fetchData);
  const { isLoading, error, data } = fetcher;

  if (isLoading) {
    return <p>Loading...</p>;
  }

  if (error) {
    return <p>Error: {error.message}</p>;
  }

  return (
    <div>
      {/* Render the fetched data */}
      <pre>{JSON.stringify(data, null, 2)}</pre>
    </div>
  );
}

Please note that the sources provided are not directly related to Remix, but they offer insights on using similar hooks and concepts in React applications.

@plocket
Copy link
Collaborator

plocket commented Sep 27, 2023

We're using useLoader for now.

Gkimbo added a commit that referenced this issue Sep 27, 2023
Co-authored-by: plocket <plocket@users.noreply.github.com>
Co-authored-by: Thad Kerosky <thadk@users.noreply.github.com>
Co-authored-by: Leopardfoot <Leopardfoot@users.noreply.github.com>
plocket added a commit that referenced this issue Sep 27, 2023
Co-authored-by: plocket <plocket@users.noreply.github.com>
Co-authored-by: Thad Kerosky <thadk@users.noreply.github.com>
Co-authored-by: Leopardfoot <Leopardfoot@users.noreply.github.com>
AdamFinkle pushed a commit to AdamFinkle/home-energy-analysis-tool that referenced this issue May 22, 2024
Co-authored-by: plocket <plocket@users.noreply.github.com>
Co-authored-by: Thad Kerosky <thadk@users.noreply.github.com>
Co-authored-by: Leopardfoot <Leopardfoot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers rules-engine Issues related to the Python rules engine
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants