-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dsb/allow-config-in-streamlit
- Loading branch information
Showing
31 changed files
with
876 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: E2E Tests Comet LLM | ||
env: | ||
COMET_RAISE_EXCEPTIONS_ON_ERROR: "1" | ||
COMET_API_KEY: ${{ secrets.PRODUCTION_CI_COMET_API_KEY }} | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
UnitTests: | ||
name: E2E_Python_${{matrix.python_version}} | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python_version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set the project name | ||
run: | | ||
echo "COMET_PROJECT_NAME=comet-llm-e2e-tests-py${{ matrix.python_version }}" >> $GITHUB_ENV | ||
- name: Print environment variables | ||
run: env | ||
|
||
- name: Print event object | ||
run: cat $GITHUB_EVENT_PATH | ||
|
||
- name: Print the PR title | ||
run: echo "${{ github.event.pull_request.title }}" | ||
|
||
- name: Setup Python ${{ matrix.python_version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python_version }} | ||
|
||
- name: Install comet-llm | ||
run: pip install -e . | ||
|
||
- name: Install test requirements | ||
run: | | ||
cd ./tests | ||
pip install --no-cache-dir --disable-pip-version-check -r test_requirements.txt | ||
- name: Running SDK e2e Tests | ||
run: python -m pytest --cov=src/comet_llm --cov-report=html:coverage_report_${{matrix.python_version}} -vv tests/e2e/ | ||
|
||
- name: archive coverage report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage_report_${{matrix.python_version}} | ||
path: coverage_report_${{matrix.python_version}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# -*- coding: utf-8 -*- | ||
# ******************************************************* | ||
# ____ _ _ | ||
# / ___|___ _ __ ___ ___| |_ _ __ ___ | | | ||
# | | / _ \| '_ ` _ \ / _ \ __| | '_ ` _ \| | | ||
# | |__| (_) | | | | | | __/ |_ _| | | | | | | | ||
# \____\___/|_| |_| |_|\___|\__(_)_| |_| |_|_| | ||
# | ||
# Sign up for free at https://www.comet.com | ||
# Copyright (C) 2015-2023 Comet ML INC | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this package. | ||
# ******************************************************* | ||
|
||
from typing import Dict, List, Optional | ||
|
||
from ..types import JSONEncodable | ||
|
||
|
||
def chain_parameters_payload( | ||
parameters: Optional[Dict[str, JSONEncodable]] | ||
) -> List[Dict[str, JSONEncodable]]: | ||
return _dict_to_payload_format(parameters, "parameterName", "parameterValue") | ||
|
||
|
||
def chain_metrics_payload( | ||
metrics: Optional[Dict[str, JSONEncodable]] | ||
) -> List[Dict[str, JSONEncodable]]: | ||
return _dict_to_payload_format(metrics, "metricName", "metricValue") | ||
|
||
|
||
def chain_others_payload( | ||
others: Optional[Dict[str, JSONEncodable]] | ||
) -> List[Dict[str, JSONEncodable]]: | ||
return _dict_to_payload_format(others, "key", "value") | ||
|
||
|
||
def _dict_to_payload_format( | ||
source: Optional[Dict[str, JSONEncodable]], key_name: str, value_name: str | ||
) -> List[Dict[str, JSONEncodable]]: | ||
if source is None: | ||
return [] | ||
|
||
result = [{key_name: key, value_name: value} for key, value in source.items()] | ||
|
||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.