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

Data Fetching Module for Mock Data #505 #516

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Jacqueline-J
Copy link

Pull Request

This pull request addresses issue #505, "Mock data UI,". Specifically, the following files were added

Added the data fetching modules under /nowcasting-app/components/helpers/

  • fetchData: A module that includes two functions: fetchData and fetchDataFromAPI. fetchData accepts a file path and a boolean flag (useMockData). It fetches data either from a local mock file (loadMockData) or from an external API (fetchDataFromAPI) based on the value of the flag. Users need to update the file path to the mock data and set the useMockData flag accordingly.
  • fetchDataFromAPI : This function sends a POST request to obtain an access token for authentication, then uses this token to fetch data from the API. Users need to update the login requirements to generate a token.
  • loadMockData :This function parses JSON data from a file and returns it. Users need to provide the file path to the mock data.

Added mock data files under data/mockData

Added mock data for Delta and PV forecast views. Three random sites were chosen for each.

Checklist:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings

Copy link

vercel bot commented May 14, 2024

@Jacqueline-J is attempting to deploy a commit to the Open Climate Fix Team on Vercel.

A member of the Team first needs to authorize it.

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

Successfully merging this pull request may close these issues.

1 participant