Skip to content

Instantly share code, notes, and snippets.

View david-andrew's full-sized avatar

David-Andrew Samson david-andrew

View GitHub Profile
@david-andrew
david-andrew / gist:31ffc4d13035c801b66db52eed8d2a7e
Last active March 21, 2024 13:50
LLM-based Annotations for ACLED 2019-2022
geo=[GeoAnnotation(name='iso', display_name=None, description='This dataset utilizes ISO 3166-1 numeric country codes to categorize incidents by country. The value "854" corresponds to Burkina Faso, indicating that the first five rows of data refer to events that occurred in Burkina Faso.', type=<ColumnType.GEO: 'geo'>, geo_type=<GeoType.COUNTRY: 'country'>, primary_geo=None, resolve_to_gadm=None, is_geo_pair=None, coord_format=None, qualifies=None, aliases={}, gadm_level=None), GeoAnnotation(name='region', display_name=None, description='This dataset categorizes various events by their geographical location within the continent of Africa, specifically focusing on the Western Africa region. This area includes countries such as Nigeria, Ghana, Senegal, and others, encompassing a diverse range of cultures, political landscapes, and socio-economic conditions. The data is structured to reflect the occurrences within this specific geographic region, highlighting the unique attributes and challenges faced by Wester
Results:
[0](WorldEnergyOutlook2023.mmd ¶ 818): The World Energy Outlook 2023 provides insight analysis and strategic insights into every aspect of the global energy system. Against a package of geometrical tensors and flexible energy markets, this work report explores how structural shifts in economies and in energy. Use of shifts the way that the world meets rise demand for energy.
[1](WorldEnergyOutlook2023.mmd ¶ 702): The _World Energy Outlook-2023_ (_WEO-2023_) explores three main scenarios in the analysis in the chapters. These scenarios are not predictions - the IEA does not have a single view on the future of the energy system. The scenarios are:
[2](WorldEnergyOutlook2023.mmd ¶ 47): The topics included in this chapter represent key themes of the _World Energy Outlook 2023_. Further information and background on the IEA Net Zero Roadmap is in _Net Zero Roadmap: A Global Pathway to Keep the 1.5 "C Goal in Reach_ published in September 2023. In addition, a range of supply and demand issues for the oi
import timeit
import random
# Class definitions
class Class0: pass
class Class1: pass
class Class2: pass
class Class3: pass
class Class4: pass
>>> what kind of analysis can you help me with?
⠸ thinking...[2024-08-13 12:20:07,022] {_client.py:1026} INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
thought: I need to provide the user with information about the types of analysis that can be
performed using the geo_power_api.
tool: final_answer
tool_input: I can help you with various types of geothermal energy analysis, including but not
limited to: assessing geothermal potential, evaluating the feasibility of geothermal projects,
analyzing geothermal resource data, and providing insights into geothermal energy production.
If you have specific data or a particular question in mind, please provide the details, and I
can assist you further.
@david-andrew
david-andrew / gist:24db57e49631dae2333cd048c2f54218
Created August 23, 2024 15:31
geothermal react example chat
>>> can you help me do a geo power analysis
⠙ thinking...[2024-08-23 11:05:30,632] {_client.py:1026} INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
thought: I need to gather the necessary parameters for the geo power analysis.
tool: geo_power_api
tool_input: {'data': {}}
observation: {'1_user_inputs': {'application': 'power', 'latitude': None, 'Longitude': None, 'subsurface favorability': 1.0, 'surface favorability': 1.0, 'geothermal gradient': 74.0, 'Surface
Temperature': 25.0, 'Depth to Basement': 4.7, 'Production Temperature': 150.0, 'Derisking Time': 1, 'Production Well Count': 5, 'Discount Rate': 9.0, 'Mass Flow Rate / Well': 50.0, 'Linear
Temperature Decline': 1.0, 'Sedimentary Drilling Cost Adjuster': 100.0, 'Basement Drilling Cost Multiplier': 1.2, 'Horizontal Well Length': 1000.0, 'Capital Expenditure Subsidy': 0.0, 'Annual
Fixed OPEX as % of Total CAPEX': 2.0, 'Wells and Plant Construction Time': 2, 'Power Plant Efficiency Increase Over Baseline': 0.0, 'Powe
@david-andrew
david-andrew / gist:d992ef49ab68057e852c85958a11330d
Created September 22, 2024 20:28
extract just policy and environment
import requests
from bs4 import BeautifulSoup
from collections import defaultdict
# from markdownify import markdownify as md
from weasyprint import HTML
from tqdm import tqdm
from enum import Enum
import pdb
>>> On the Proteomic Data Commons site, find the number of clinical cases with Hepatocellular Carcinoma
thought: I need to find an API related to the Proteomic Data Commons to retrieve information about clinical cases with Hepatocellular Carcinoma.
tool: AdhocApi.list_apis
tool_input: None
observation: {'Proteomic Data Commons': {'description': "The Proteomics Data Commons (PDC) is a comprehensive, open-access resource that stores,\nmanages, and shares large-scale proteomic
data for cancer and other biomedical research.\nIt is part of the National Cancer Institute's broader data ecosystem, enabling researchers\nto access and analyze proteomic datasets, including
mass spectrometry data and related\nmetadata. The PDC supports integrative research by providing standardized data formats\nand analysis tools, facilitating the discovery of protein
biomarkers and insights into\ncancer biology, which helps in advancing personalized medicine and treatment approaches.\n"}}
>>> what apis are available?
thought: I will list all the available APIs to provide the user with the information they need.
tool: AdhocApi.list_apis
tool_input: None
observation: {'Proteomic Data Commons': {'description': "The Proteomics Data Commons (PDC) is a comprehensive, open-access resource that stores,\nmanages, and shares large-scale proteomic
data for cancer and other biomedical research.\nIt is part of the National Cancer Institute's broader data ecosystem, enabling researchers\nto access and analyze proteomic datasets, including
mass spectrometry data and related\nmetadata. The PDC supports integrative research by providing standardized data formats\nand analysis tools, facilitating the discovery of protein
biomarkers and insights into\ncancer biology, which helps in advancing personalized medicine and treatment approaches.\n"}}
@david-andrew
david-andrew / gist:125bbab42d3673d39db78927d50e4b62
Last active November 8, 2024 16:50
PDC API Test example 2
>>> From the Proteomic Data Commons site, use the api tool to download the biospecimen metadata for specimens with processed mass spectra data from patients with endometrial cancer.
thought: I need to list the available APIs to find the one related to the Proteomic Data Commons.
tool: AdhocApi.list_apis
tool_input: None
observation: {'Proteomic Data Commons': {'description': "The Proteomics Data Commons (PDC) is a comprehensive, open-access resource that stores,\nmanages, and shares large-scale proteomic
data for cancer and other biomedical research.\nIt is part of the National Cancer Institute's broader data ecosystem, enabling researchers\nto access and analyze proteomic datasets, including
mass spectrometry data and related\nmetadata. The PDC supports integrative research by providing standardized data formats\nand analysis tools, facilitating the discovery of protein
biomarkers and insights into\ncancer biology, which helps in advancing personalized medicine and treatment approaches.\n"}}
>>> From the Proteomic Data Commons, use the api tool to download a metadata file with information about proteome protein assembly data files from primary tumor samples. Exclude any disqualified cases and specimens.
thought: First, I need to list the available APIs to find the Proteomic Data Commons API.
tool: AdhocApi.list_apis
tool_input: None
observation: {'Proteomic Data Commons': {'description': "The Proteomics Data Commons (PDC) is a comprehensive, open-access resource that stores,\nmanages, and shares large-scale proteomic
data for cancer and other biomedical research.\nIt is part of the National Cancer Institute's broader data ecosystem, enabling researchers\nto access and analyze proteomic datasets, including
mass spectrometry data and related\nmetadata. The PDC supports integrative research by providing standardized data formats\nand analysis tools, facilitating the discovery of protein
biomarkers and insights into\ncancer biology, which helps in advancing personalized medicine and treatment appr