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

Added ABC method/s #256

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

tg359
Copy link
Contributor

@tg359 tg359 commented Nov 6, 2024

Issues addressed by this PR

Closes #255

Methods added for creating a case to send to the ABC API, and getting the data returned from that API call.

Test files

See the included pytest files in this PR. The following may be run as an alternative:

from ladybugtools_toolkit.abc.abc_model import ABCModel
from ladybugtools_toolkit.abc.util import run_abc
import pandas as pd
from pathlib import Path

# create ABC model
abc_model = ABCModel.from_csv(csv_file="./LadybugTools_Toolkit/LadybugTools_Engine/Python/tests/assets/example_abc_phases.csv", name="test", description="test")

# set filepaths
input_json_file = Path("./").resolve() / "input_json_file.json"
output_json_file = Path("./").resolve() / "output_json_file.json"
output_csv_file = Path("./").resolve() / "output_csv_file.csv"

# write model to file
abc_model.to_file(input_json_file)

# pass model to API, and convert response to CSV
run_abc(
    input_json_file=input_json_file,
    output_json_file=output_json_file,
    output_csv_file=output_csv_file,
)

# load response as pandas DataFrame
results_df = pd.read_csv(output_csv_file)

Changelog

Additional comments

@tg359 tg359 added size:S Measured in minutes type:feature New capability or enhancement priority:low Resources should be targeted to other issues first labels Nov 6, 2024
@tg359 tg359 self-assigned this Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:low Resources should be targeted to other issues first size:S Measured in minutes type:feature New capability or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ABC methods to toolkit
1 participant