Skip to content

Commit 5f70a5d

Browse files
committed
Update example and CI file.
1 parent 54d0351 commit 5f70a5d

File tree

2 files changed

+9
-29
lines changed

2 files changed

+9
-29
lines changed

.github/workflows/comet.yml

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,38 +17,22 @@ jobs:
1717
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
1818

1919
steps:
20-
- name: Checkout Repository
21-
uses: actions/checkout@v4
22-
23-
- name: Setup Python ${{ matrix.python-version }}
20+
- uses: actions/checkout@v4
21+
- name: setup-python${{ matrix.python-version }}
2422
uses: actions/setup-python@v5
2523
with:
2624
python-version: ${{ matrix.python-version }}
27-
28-
- name: Install Dependencies
25+
- name: Install (Python)
2926
run: |
3027
python -m pip install --upgrade pip
3128
pip install --progress-bar off -U setuptools
3229
pip install git+https://github.com/optuna/optuna.git
30+
python -c 'import optuna'
3331
pip install git+https://github.com/optuna/optuna-integration.git
32+
python -c 'import optuna_integration'
3433
pip install -r comet/requirements.txt
35-
36-
- name: Set API Key
34+
- name: Run examples
3735
run: |
38-
echo "COMET_API_KEY=${{ secrets.COMET_API_KEY }}" >> $GITHUB_ENV
39-
40-
- name: Debug API Key
41-
run: |
42-
echo "Checking COMET_API_KEY..."
43-
if [ -z "$COMET_API_KEY" ]; then
44-
echo "❌ COMET_API_KEY is NOT set!"
45-
exit 1
46-
else
47-
echo "✅ COMET_API_KEY is set."
48-
fi
49-
50-
- name: Run Examples
51-
run: python comet/comet_callback.py
36+
python comet/comet_callback.py
5237
env:
53-
OMP_NUM_THREADS: 1
54-
COMET_API_KEY: ${{ secrets.COMET_API_KEY }}
38+
OMP_NUM_THREADS: 1

comet/comet_callback.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
$ python comet_callback.py
1616
"""
1717

18-
import os
19-
2018
import comet_ml
2119
import optuna
2220
from optuna_integration.comet import CometCallback
@@ -29,9 +27,7 @@
2927
from sklearn.model_selection import train_test_split
3028

3129

32-
# Ensure the API key is available
33-
if not os.getenv("COMET_API_KEY"):
34-
raise ValueError("COMET_API_KEY is missing! Please set it as an environment variable.")
30+
comet_ml.login() # Explicit login
3531

3632
# Start the experiment using comet_ml.start()
3733
experiment = comet_ml.start()

0 commit comments

Comments
 (0)