Skip to content

Commit

Permalink
feat: showcase different methods
Browse files Browse the repository at this point in the history
  • Loading branch information
HagenFritz committed Jun 18, 2024
1 parent 1764a25 commit 7b67e99
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
8 changes: 3 additions & 5 deletions snippets/explore_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@ def main():
# Get Specific Project
# --------------------
print("\nGet Specific Project")
project_id = projects[-1]["id"] # pull the last ID from the previously queried projects list
project_id = 47939
project_details = projects_api.get_project(project_id=project_id)

# Show project
output_projects(project_list=[project_details]) # convert single project to list to use output function
print(json.dumps(project_details, indent=4))

# Get Project by Name
name_to_find = "212096 - 401 FIRST STREET (College Station)" # replace with your project name
Expand All @@ -77,7 +75,7 @@ def main():
# Get Project Comments
# --------------------
print("\nGet Project Comments")
for project in projects:
for project in projects[:4]:
try:
project_comments = projects_api.get_project_comments(project_id=project["id"])
print(project_comments)
Expand Down
21 changes: 19 additions & 2 deletions snippets/explore_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def main():
scenarios_api = Scenarios(client)
schedule_api = Schedule(client)

# Get Schedule Quality
# --------------------
# Get Schedule Quality - Example 1
# --------------------------------
# Find project by name
name_to_find = "212096 - 401 FIRST STREET (College Station)" # replace with your project name
project = projects_api.find_project_by_name(name=name_to_find)
Expand All @@ -46,6 +46,23 @@ def main():
print(json.dumps(schedule_quality_data, indent=4))
# --------------------

# Get Schedule Quality - Example 2
# --------------------------------
# Find project by id
project_id = 47939
project = projects_api.get_project(project_id=project_id)
project_id = project["id"]
scenario_id = project["defaultScenarioId"]

print("Get Schedule Quality")
schedule_quality_data = schedule_api.get_schedule_quality(
project_id=project_id,
scenario_id=scenario_id
)
#with open(f"./schedule-quality-{project_id}-{scenario_id}.json", "w") as f:
# json.dump(schedule_quality_data, f, indent=4)
# --------------------

# Get Schedule Quality Metrics
# ----------------------------
print("Get Schedule Grade")
Expand Down

0 comments on commit 7b67e99

Please sign in to comment.