ethoscopy 2.0.1__tar.gz → 2.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. ethoscopy-2.0.3/.claude/settings.local.json +25 -0
  2. ethoscopy-2.0.3/.codecov.yml +26 -0
  3. ethoscopy-2.0.3/.github/workflows/ci.yml +151 -0
  4. ethoscopy-2.0.3/.github/workflows/release.yml +74 -0
  5. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/.gitignore +2 -1
  6. ethoscopy-2.0.3/.pre-commit-config.yaml +62 -0
  7. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/CLAUDE.md +2 -2
  8. ethoscopy-2.0.3/Docker/.claude/settings.local.json +19 -0
  9. ethoscopy-2.0.3/Docker/.env +39 -0
  10. ethoscopy-2.0.3/Docker/.env.keycloak +39 -0
  11. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/Docker/README.md +1 -3
  12. ethoscopy-2.0.3/Docker/config/jupyterhub.sqlite +0 -0
  13. ethoscopy-2.0.3/Docker/config/jupyterhub_cookie_secret +1 -0
  14. ethoscopy-2.0.3/Docker/jupyterhub_data/jupyterhub-proxy.pid +1 -0
  15. ethoscopy-2.0.3/Docker/jupyterhub_data/jupyterhub.sqlite +0 -0
  16. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/Docker/jupyterhub_data/jupyterhub_config.py +4 -4
  17. ethoscopy-2.0.3/Docker/jupyterhub_data/jupyterhub_cookie_secret +1 -0
  18. ethoscopy-2.0.1/README.md → ethoscopy-2.0.3/PKG-INFO +83 -3
  19. ethoscopy-2.0.3/QWEN.md +88 -0
  20. ethoscopy-2.0.1/PKG-INFO → ethoscopy-2.0.3/README.md +44 -22
  21. ethoscopy-2.0.3/TESTING.md +275 -0
  22. ethoscopy-2.0.3/_config.yml +1 -0
  23. ethoscopy-2.0.3/pyproject.toml +63 -0
  24. ethoscopy-2.0.3/pytest.ini +22 -0
  25. ethoscopy-2.0.3/run_tests.py +76 -0
  26. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/setup.py +2 -2
  27. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/__init__.py +20 -20
  28. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/analyse.py +318 -242
  29. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/behavpy.py +31 -15
  30. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/behavpy_HMM_class.py +24 -14
  31. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/behavpy_class.py +24 -14
  32. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/behavpy_core.py +1152 -642
  33. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/behavpy_draw.py +1162 -531
  34. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/behavpy_periodogram_class.py +24 -14
  35. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/behavpy_plotly.py +2527 -1230
  36. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/behavpy_seaborn.py +1881 -704
  37. ethoscopy-2.0.3/src/ethoscopy/load.py +954 -0
  38. ethoscopy-2.0.3/src/ethoscopy/metadata_db.py +422 -0
  39. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/misc/circadian_bars.py +58 -32
  40. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/misc/general_functions.py +41 -33
  41. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/misc/get_HMM.py +9 -9
  42. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/misc/get_tutorials.py +15 -11
  43. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/misc/hmm_functions.py +43 -38
  44. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/misc/periodogram_functions.py +139 -99
  45. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/misc/validate_datetime.py +16 -11
  46. ethoscopy-2.0.3/tests/__init__.py +3 -0
  47. ethoscopy-2.0.3/tests/conftest.py +247 -0
  48. ethoscopy-2.0.3/tests/data/README.md +13 -0
  49. ethoscopy-2.0.3/tests/data/test_ethoscope.db +0 -0
  50. ethoscopy-2.0.3/tests/test_analyse.py +438 -0
  51. ethoscopy-2.0.3/tests/test_baseline_enhancements.py +452 -0
  52. ethoscopy-2.0.3/tests/test_behavpy.py +408 -0
  53. ethoscopy-2.0.3/tests/test_behavpy_core_simple.py +298 -0
  54. ethoscopy-2.0.3/tests/test_compatibility_classes.py +285 -0
  55. ethoscopy-2.0.3/tests/test_general_functions.py +135 -0
  56. ethoscopy-2.0.3/tests/test_get_tutorials.py +136 -0
  57. ethoscopy-2.0.3/tests/test_load.py +431 -0
  58. ethoscopy-2.0.3/tests/test_load_comprehensive.py +782 -0
  59. ethoscopy-2.0.3/tests/test_load_optimizations.py +635 -0
  60. ethoscopy-2.0.1/.claude/settings.local.json +0 -16
  61. ethoscopy-2.0.1/_config.yml +0 -1
  62. ethoscopy-2.0.1/pyproject.toml +0 -38
  63. ethoscopy-2.0.1/src/ethoscopy/load.py +0 -618
  64. ethoscopy-2.0.1/src/ethoscopy/metadata_db.py +0 -380
  65. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/Docker/Dockerfile +0 -0
  66. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/Docker/docker-compose.yml +0 -0
  67. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/Docker/install_r_packages.r +0 -0
  68. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/LICENSE +0 -0
  69. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/src/ethoscopy/misc/__init__.py +0 -0
  70. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/tutorial_notebook/1_Overview_tutorial.ipynb +0 -0
  71. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/tutorial_notebook/2_HMM_tutorial.ipynb +0 -0
  72. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/tutorial_notebook/3_Circadian_tutorial.ipynb +0 -0
  73. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/tutorial_notebook/4_Navigating_db_tutorial.ipynb +0 -0
  74. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/tutorial_notebook/5_Ethoscopy_catch22_tutorial.ipynb +0 -0
  75. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/tutorial_notebook/6_Ethoscopy_to_hctsa_tutorial.ipynb +0 -0
  76. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/tutorial_notebook/ethoscope_db.csv +0 -0
  77. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/tutorial_notebook/jones_et_al_metadata.csv +0 -0
  78. {ethoscopy-2.0.1 → ethoscopy-2.0.3}/tutorial_notebook/notebook_paper.ipynb +0 -0
@@ -0,0 +1,25 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(git add:*)",
5
+ "Bash(git commit:*)",
6
+ "Bash(python:*)",
7
+ "Bash(ls:*)",
8
+ "Bash(find:*)",
9
+ "Bash(docker exec ethoscope-lab ls -la \"/mnt/ethoscope_results/26634d78becf48628fe5d9ffc67fae04/ETHOSCOPE_266/2025-07-29_19-12-16/2025-07-29_19-12-16_26634d78becf48628fe5d9ffc67fae04.db\")",
10
+ "Bash(docker exec:*)",
11
+ "Bash(source:*)",
12
+ "Bash(git push:*)",
13
+ "Bash(mkdir:*)",
14
+ "Bash(cp:*)",
15
+ "Bash(sqlite3:*)",
16
+ "Bash(black:*)",
17
+ "Bash(grep:*)",
18
+ "Bash(pip install:*)",
19
+ "Bash(git stash pop:*)",
20
+ "Bash(git checkout:*)",
21
+ "Bash(git tag:*)"
22
+ ],
23
+ "deny": []
24
+ }
25
+ }
@@ -0,0 +1,26 @@
1
+ coverage:
2
+ range: 50..90
3
+ round: down
4
+ precision: 2
5
+
6
+ status:
7
+ project:
8
+ default:
9
+ target: auto
10
+ threshold: 1%
11
+ base: auto
12
+ patch:
13
+ default:
14
+ target: auto
15
+ threshold: 1%
16
+ base: auto
17
+
18
+ comment:
19
+ layout: "reach, diff, flags, files"
20
+ behavior: default
21
+
22
+ ignore:
23
+ - "tests/"
24
+ - "tutorial_notebook/"
25
+ - "setup.py"
26
+ - "run_tests.py"
@@ -0,0 +1,151 @@
1
+ name: CI/CD Pipeline
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, develop ]
6
+ pull_request:
7
+ branches: [ main ]
8
+ schedule:
9
+ # Run tests daily at 6 AM UTC
10
+ - cron: '0 6 * * *'
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ matrix:
17
+ python-version: ['3.10', '3.11', '3.12']
18
+
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - name: Set up Python ${{ matrix.python-version }}
23
+ uses: actions/setup-python@v4
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+
27
+ - name: Cache pip dependencies
28
+ uses: actions/cache@v3
29
+ with:
30
+ path: ~/.cache/pip
31
+ key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
32
+ restore-keys: |
33
+ ${{ runner.os }}-pip-
34
+
35
+ - name: Install dependencies
36
+ run: |
37
+ python -m pip install --upgrade pip
38
+ pip install -e ".[dev]"
39
+ pip install pytest-cov pytest-xdist pytest-mock
40
+
41
+ - name: Lint with ruff
42
+ run: |
43
+ pip install ruff
44
+ ruff check src/
45
+
46
+ - name: Format check with black
47
+ run: |
48
+ pip install black
49
+ black --check src/ tests/
50
+
51
+ - name: Run unit tests
52
+ run: |
53
+ python -m pytest tests/ -v --cov=ethoscopy --cov-report=xml --cov-report=term-missing -m "unit"
54
+
55
+ - name: Run integration tests
56
+ run: |
57
+ python -m pytest tests/ -v -m "integration"
58
+
59
+ - name: Upload coverage reports to Codecov
60
+ uses: codecov/codecov-action@v5
61
+ with:
62
+ token: ${{ secrets.CODECOV_TOKEN }}
63
+ slug: gilestrolab/ethoscopy
64
+
65
+ test-notebooks:
66
+ runs-on: ubuntu-latest
67
+ needs: test
68
+
69
+ steps:
70
+ - uses: actions/checkout@v4
71
+
72
+ - name: Set up Python 3.11
73
+ uses: actions/setup-python@v4
74
+ with:
75
+ python-version: '3.11'
76
+
77
+ - name: Install dependencies
78
+ run: |
79
+ python -m pip install --upgrade pip
80
+ pip install -e ".[dev]"
81
+ pip install nbval jupyter
82
+
83
+ - name: Test notebooks
84
+ run: |
85
+ pytest --nbval-lax tutorial_notebook/*.ipynb -v
86
+ continue-on-error: true # Notebooks may fail due to data dependencies
87
+
88
+ build:
89
+ runs-on: ubuntu-latest
90
+ needs: [test, test-notebooks]
91
+
92
+ steps:
93
+ - uses: actions/checkout@v4
94
+
95
+ - name: Set up Python 3.11
96
+ uses: actions/setup-python@v4
97
+ with:
98
+ python-version: '3.11'
99
+
100
+ - name: Install build dependencies
101
+ run: |
102
+ python -m pip install --upgrade pip
103
+ pip install build twine
104
+
105
+ - name: Build package
106
+ run: |
107
+ python -m build
108
+
109
+ - name: Check package
110
+ run: |
111
+ twine check dist/*
112
+
113
+ - name: Upload build artifacts
114
+ uses: actions/upload-artifact@v4
115
+ with:
116
+ name: dist-files
117
+ path: dist/
118
+
119
+ security-scan:
120
+ runs-on: ubuntu-latest
121
+
122
+ steps:
123
+ - uses: actions/checkout@v4
124
+
125
+ - name: Set up Python 3.11
126
+ uses: actions/setup-python@v4
127
+ with:
128
+ python-version: '3.11'
129
+
130
+ - name: Install dependencies
131
+ run: |
132
+ python -m pip install --upgrade pip
133
+ pip install bandit safety
134
+
135
+ - name: Run security scan with bandit
136
+ run: |
137
+ bandit -r src/ -f json -o bandit-report.json
138
+ continue-on-error: true
139
+
140
+ - name: Run safety check
141
+ run: |
142
+ safety check --json --output safety-report.json
143
+ continue-on-error: true
144
+
145
+ - name: Upload security reports
146
+ uses: actions/upload-artifact@v4
147
+ with:
148
+ name: security-reports
149
+ path: |
150
+ bandit-report.json
151
+ safety-report.json
@@ -0,0 +1,74 @@
1
+ name: Release to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ push:
7
+ tags:
8
+ - 'v*.*.*'
9
+
10
+ jobs:
11
+ test:
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ python-version: ['3.10', '3.11', '3.12']
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Set up Python ${{ matrix.python-version }}
21
+ uses: actions/setup-python@v4
22
+ with:
23
+ python-version: ${{ matrix.python-version }}
24
+
25
+ - name: Install dependencies
26
+ run: |
27
+ python -m pip install --upgrade pip
28
+ pip install -e ".[dev]"
29
+ pip install pytest-cov
30
+
31
+ - name: Run tests
32
+ run: |
33
+ python -m pytest tests/ -v --cov=ethoscopy -m "not slow"
34
+
35
+ build-and-publish:
36
+ needs: test
37
+ runs-on: ubuntu-latest
38
+
39
+ steps:
40
+ - uses: actions/checkout@v4
41
+
42
+ - name: Set up Python 3.11
43
+ uses: actions/setup-python@v4
44
+ with:
45
+ python-version: '3.11'
46
+
47
+ - name: Install build dependencies
48
+ run: |
49
+ python -m pip install --upgrade pip
50
+ pip install build twine
51
+
52
+ - name: Build package
53
+ run: |
54
+ python -m build
55
+
56
+ - name: Check package
57
+ run: |
58
+ twine check dist/*
59
+
60
+ - name: Publish to Test PyPI
61
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
62
+ env:
63
+ TWINE_USERNAME: __token__
64
+ TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
65
+ run: |
66
+ twine upload --repository testpypi dist/*
67
+
68
+ - name: Publish to PyPI
69
+ if: github.event_name == 'release'
70
+ env:
71
+ TWINE_USERNAME: __token__
72
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
73
+ run: |
74
+ twine upload dist/*
@@ -7,4 +7,5 @@ __pycache__/
7
7
  ethoscopy.egg-info/
8
8
  .gitignore
9
9
  *.pkl
10
- .python-version
10
+ .python-version
11
+ tmp
@@ -0,0 +1,62 @@
1
+ repos:
2
+ # General file checks
3
+ - repo: https://github.com/pre-commit/pre-commit-hooks
4
+ rev: v5.0.0
5
+ hooks:
6
+ - id: trailing-whitespace
7
+ files: \.(py|yml|yaml|md|txt)$
8
+ - id: end-of-file-fixer
9
+ files: \.(py|yml|yaml|md|txt)$
10
+ - id: check-yaml
11
+ - id: check-toml
12
+ - id: check-merge-conflict
13
+ - id: check-added-large-files
14
+ args: ['--maxkb=1000']
15
+ - id: debug-statements
16
+ files: ^(src/|tests/).*\.py$
17
+ - id: check-ast
18
+ files: ^(src/|tests/).*\.py$
19
+
20
+ # Black - Code formatting
21
+ - repo: https://github.com/psf/black
22
+ rev: 24.10.0
23
+ hooks:
24
+ - id: black
25
+ args: [--line-length=88]
26
+ files: ^(src/|tests/).*\.py$
27
+
28
+ # Ruff - Linting and code analysis
29
+ - repo: https://github.com/astral-sh/ruff-pre-commit
30
+ rev: v0.8.4
31
+ hooks:
32
+ - id: ruff
33
+ args: [--fix, --exit-non-zero-on-fix]
34
+ files: ^src/.*\.py$
35
+ - id: ruff-format
36
+ files: ^(src/|tests/).*\.py$
37
+
38
+ # Import sorting
39
+ - repo: https://github.com/pycqa/isort
40
+ rev: 5.13.2
41
+ hooks:
42
+ - id: isort
43
+ args: [--profile, black, --line-length=88]
44
+ files: ^(src/|tests/).*\.py$
45
+
46
+ - repo: local
47
+ hooks:
48
+ - id: pytest-unit
49
+ name: pytest-unit
50
+ entry: .venv/bin/python -m pytest tests/ -m "unit" -v
51
+ language: system
52
+ pass_filenames: false
53
+ always_run: true
54
+ stages: [commit]
55
+
56
+ - id: pytest-fast
57
+ name: pytest-fast
58
+ entry: .venv/bin/python -m pytest tests/ -m "not slow" -v --tb=short
59
+ language: system
60
+ pass_filenames: false
61
+ always_run: true
62
+ stages: [push]
@@ -10,7 +10,7 @@ Ethoscopy is a Python data analysis toolbox for behavioral time series data from
10
10
 
11
11
  ### Python Environment
12
12
  - **Use Python 3.10+** (project requires >=3.10,<4.0)
13
- - **Always use virtual environment** (`venv_linux` as mentioned in user's global instructions)
13
+ - **Always use virtual environment** (`.venv` as mentioned in user's global instructions)
14
14
  - **Install in development mode**: `pip install -e .`
15
15
 
16
16
  ### Package Management
@@ -108,4 +108,4 @@ df = etho.behavpy(data, metadata, check=True, canvas='plotly', palette='Set2')
108
108
  ### Documentation
109
109
  - **Docstrings**: Google style required for all functions
110
110
  - **Tutorial notebooks**: Primary documentation method
111
- - **README.md**: Keep updated with installation and basic usage
111
+ - **README.md**: Keep updated with installation and basic usage
@@ -0,0 +1,19 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(ls:*)",
5
+ "Bash(git checkout:*)",
6
+ "Bash(docker images:*)",
7
+ "Read(//tmp/**)",
8
+ "Bash(JUPYTER_HUB_TAG=5.3.0 ETHOSCOPE_LAB_TAG=1.1 docker compose build:*)",
9
+ "Bash(tee:*)",
10
+ "Bash(docker compose:*)",
11
+ "Bash(find:*)",
12
+ "Bash(sqlite3:*)",
13
+ "Bash(python3:*)",
14
+ "Bash(docker exec:*)",
15
+ "Bash(docker cp:*)"
16
+ ],
17
+ "deny": []
18
+ }
19
+ }
@@ -0,0 +1,39 @@
1
+ # Keycloak OAuth Configuration for JupyterHub
2
+ # To use: cp .env.keycloak .env && docker compose restart
3
+
4
+ # Image versions
5
+ JUPYTER_HUB_TAG=5.3.0
6
+ ETHOSCOPE_LAB_TAG=1.1
7
+
8
+ # Authentication
9
+ AUTHENTICATOR_CLASS=generic
10
+ DUMMY_PASSWORD=ethoscope
11
+
12
+ # User configuration
13
+ ALLOWED_USERS=amadabhushi,ggilestro,mjoyce,lguo,labguest1,labguest2,labguest3,labguest4,labguest5,labguest6,labguest7,ethoscopelab
14
+ ADMIN_USERS=ggilestro
15
+
16
+ # User/Group IDs (must match your host system)
17
+ UID=1000
18
+ GID=1000
19
+
20
+ # Keycloak OAuth Settings
21
+ OAUTH_CLIENT_ID=jupyter-lab
22
+ OAUTH_CLIENT_SECRET=pBUaqP6b8bO5IamJ7jw4lD3l5EyKJaKq
23
+ OAUTH_CALLBACK_URL=https://jupyter.lab.gilest.ro/hub/oauth_callback
24
+
25
+ # Keycloak endpoints (realm: gilestro-lab)
26
+ OAUTH_AUTHORIZE_URL=https://auth.gilest.ro/realms/gilestro-lab/protocol/openid-connect/auth
27
+ OAUTH_TOKEN_URL=https://auth.gilest.ro/realms/gilestro-lab/protocol/openid-connect/token
28
+ OAUTH_USERDATA_URL=https://auth.gilest.ro/realms/gilestro-lab/protocol/openid-connect/userinfo
29
+
30
+ # Username claim (Keycloak typically uses 'preferred_username')
31
+ OAUTH_USERNAME_CLAIM=preferred_username
32
+
33
+ # OAuth scopes
34
+ OAUTH_SCOPE=openid profile email
35
+
36
+ # Provider-specific (not used for Keycloak, but needed for env validation)
37
+ GITHUB_ORG=
38
+ GOOGLE_HOSTED_DOMAIN=
39
+ GITLAB_URL=
@@ -0,0 +1,39 @@
1
+ # Keycloak OAuth Configuration for JupyterHub
2
+ # To use: cp .env.keycloak .env && docker compose restart
3
+
4
+ # Image versions
5
+ JUPYTER_HUB_TAG=5.3.0
6
+ ETHOSCOPE_LAB_TAG=1.1
7
+
8
+ # Authentication
9
+ AUTHENTICATOR_CLASS=generic
10
+ DUMMY_PASSWORD=ethoscope
11
+
12
+ # User configuration
13
+ ALLOWED_USERS=amadabhushi,ggilestro,mjoyce,lguo,labguest1,labguest2,labguest3,labguest4,labguest5,labguest6,labguest7,ethoscopelab
14
+ ADMIN_USERS=ggilestro
15
+
16
+ # User/Group IDs (must match your host system)
17
+ UID=1000
18
+ GID=1000
19
+
20
+ # Keycloak OAuth Settings
21
+ OAUTH_CLIENT_ID=jupyter-lab
22
+ OAUTH_CLIENT_SECRET=pBUaqP6b8bO5IamJ7jw4lD3l5EyKJaKq
23
+ OAUTH_CALLBACK_URL=https://jupyter.lab.gilest.ro/hub/oauth_callback
24
+
25
+ # Keycloak endpoints (realm: gilestro-lab)
26
+ OAUTH_AUTHORIZE_URL=https://auth.gilest.ro/realms/gilestro-lab/protocol/openid-connect/auth
27
+ OAUTH_TOKEN_URL=https://auth.gilest.ro/realms/gilestro-lab/protocol/openid-connect/token
28
+ OAUTH_USERDATA_URL=https://auth.gilest.ro/realms/gilestro-lab/protocol/openid-connect/userinfo
29
+
30
+ # Username claim (Keycloak typically uses 'preferred_username')
31
+ OAUTH_USERNAME_CLAIM=preferred_username
32
+
33
+ # OAuth scopes
34
+ OAUTH_SCOPE=openid profile email
35
+
36
+ # Provider-specific (not used for Keycloak, but needed for env validation)
37
+ GITHUB_ORG=
38
+ GOOGLE_HOSTED_DOMAIN=
39
+ GITLAB_URL=
@@ -6,7 +6,7 @@ The ethoscopelab docker instance lives on dockerhub at the following address: [h
6
6
 
7
7
  ## Docker files that were used to create the ethoscope-lab docker instance
8
8
 
9
- The files in this folder can be used to recreate the image as uploaded on dockerhub.
9
+ The files in this folder can be used to recreate the image as uploaded on dockerhub.
10
10
 
11
11
  The command to use to recreate that image is `JUPYTER_HUB_TAG=5.3.0 ETHOSCOPE_LAB_TAG=1.0 docker compose build`. This creates the image with the specified tag. For Docker Hub deployment, push the image: `docker push ggilestro/ethoscope-lab:1.0`. To also create a latest tag: `docker tag ggilestro/ethoscope-lab:1.0 ggilestro/ethoscope-lab:latest && docker push ggilestro/ethoscope-lab:latest`. You can verify your local images with `docker images | grep ethoscope-lab`.
12
12
 
@@ -83,5 +83,3 @@ volumes:
83
83
  ```
84
84
 
85
85
  This ensures all user work is preserved even when containers are recreated or updated.
86
-
87
-
@@ -0,0 +1 @@
1
+ dc4907b418101083a39e9e3f1d9e2cf2014f9a9b17dedaf584f36f3300cc44be
@@ -29,21 +29,21 @@ class ConfigUserSpawner(LocalProcessSpawner):
29
29
  def make_preexec_fn(self, name):
30
30
  """Don't try to switch users - run everything as current user"""
31
31
  return None
32
-
32
+
33
33
  def user_env(self, env):
34
34
  """Set user environment without system user lookup"""
35
35
  env = env.copy()
36
36
  home_dir = f'/home/{self.user.name}'
37
-
37
+
38
38
  # Ensure home directory exists with proper permissions
39
39
  os.makedirs(home_dir, mode=0o755, exist_ok=True)
40
-
40
+
41
41
  # Set environment variables
42
42
  env['USER'] = self.user.name
43
43
  env['HOME'] = home_dir
44
44
  env['SHELL'] = '/bin/bash'
45
45
  env['LOGNAME'] = self.user.name
46
-
46
+
47
47
  return env
48
48
 
49
49
  c.JupyterHub.spawner_class = ConfigUserSpawner
@@ -0,0 +1 @@
1
+ 90911154c749321ff6ebb164e8501c130e62388a387de6b121cc889ef518aa85
@@ -1,4 +1,49 @@
1
- # ethoscopy
1
+ Metadata-Version: 2.4
2
+ Name: ethoscopy
3
+ Version: 2.0.3
4
+ Summary: "A python based toolkit to download and anlyse data from the Ethoscope hardware system."
5
+ Author-email: Lblackhurst29 <lblackhurst29@gmail.com>
6
+ License-File: LICENSE
7
+ Classifier: Development Status :: 4 - Beta
8
+ Classifier: Intended Audience :: Science/Research
9
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
16
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
17
+ Requires-Python: <4.0,>=3.10
18
+ Requires-Dist: astropy<7.0,>=6.1
19
+ Requires-Dist: colour<0.2.0,>=0.1.5
20
+ Requires-Dist: hmmlearn<0.4.0,>=0.3.2
21
+ Requires-Dist: nbformat<6.0.0,>=5.10.4
22
+ Requires-Dist: numpy<3.0.0,>=2.0.0
23
+ Requires-Dist: pandas<3.0.0,>=2.2.2
24
+ Requires-Dist: plotly<6.0.0,>=5.22.0
25
+ Requires-Dist: pywavelets<2.0.0,>=1.6.0
26
+ Requires-Dist: seaborn<0.14.0,>=0.13.2
27
+ Requires-Dist: tabulate<0.10.0,>=0.9.0
28
+ Provides-Extra: dev
29
+ Requires-Dist: black<25.0.0,>=24.0.0; extra == 'dev'
30
+ Requires-Dist: ipykernel<7.0.0,>=6.29.5; extra == 'dev'
31
+ Requires-Dist: isort<6.0.0,>=5.13.0; extra == 'dev'
32
+ Requires-Dist: pre-commit<4.0.0,>=3.0.0; extra == 'dev'
33
+ Requires-Dist: pytest-cov<6.0.0,>=5.0.0; extra == 'dev'
34
+ Requires-Dist: pytest-mock<4.0.0,>=3.12.0; extra == 'dev'
35
+ Requires-Dist: pytest-xdist<4.0.0,>=3.5.0; extra == 'dev'
36
+ Requires-Dist: pytest<9.0.0,>=8.0.0; extra == 'dev'
37
+ Requires-Dist: ruff<1.0.0,>=0.1.0; extra == 'dev'
38
+ Description-Content-Type: text/markdown
39
+
40
+ # ethoscopy
41
+
42
+ [![CI/CD Pipeline](https://github.com/gilestrolab/ethoscopy/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/gilestrolab/ethoscopy/actions/workflows/ci.yml)
43
+ [![codecov](https://codecov.io/gh/gilestrolab/ethoscopy/branch/main/graph/badge.svg)](https://codecov.io/gh/gilestrolab/ethoscopy)
44
+ [![PyPI version](https://img.shields.io/pypi/v/ethoscopy.svg)](https://pypi.org/project/ethoscopy/)
45
+ [![Python versions](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue.svg)](https://pypi.org/project/ethoscopy/)
46
+ [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
2
47
 
3
48
  A data-analysis toolbox utilising Pandas, Seaborn, and Plotly to curate, clean, analyse, and visualise behavioural time series data. Whilst the toolbix was created around the data produced from an Ethoscope (a Drosophila monitoring system), if the users data follows the same structure for time series data all methods can be utilised.
4
49
 
@@ -19,7 +64,7 @@ This new update sees a whole refactoring of the code base to make everything mor
19
64
 
20
65
  The latest update is backwards compatible with all previously saved behavpy dataframes. However, post loading they should be re-initiated as the new behavpy class. See in the getting started a demonstration of what to do.
21
66
 
22
- Addtionally, the concat method ( behavpy_object.concat() ) for combining dataframes has been shifted to a function that is imported automatically. Call etho.concat(df1, df2) or etho.concat(*[df1, df2]) instead. There are other minor changes to method and argument names, which are reflected in their docstrings and in the tutorial.
67
+ Addtionally, the concat method ( behavpy_object.concat() ) for combining dataframes has been shifted to a function that is imported automatically. Call etho.concat(df1, df2) or etho.concat(*[df1, df2]) instead. There are other minor changes to method and argument names, which are reflected in their docstrings and in the tutorial.
23
68
 
24
69
  ## Getting Started
25
70
 
@@ -59,6 +104,41 @@ import pandas as pd
59
104
  df = pd.read_pickle('path/to/your/file.pkl')
60
105
  df = etho.behavpy(df, df.meta, check = True, canvas = 'plotly', palette = 'Set2')
61
106
  ```
107
+
108
+ ## Development and Testing
109
+
110
+ Ethoscopy includes a comprehensive test suite to ensure code reliability and prevent regressions.
111
+
112
+ ### Running Tests
113
+
114
+ Install development dependencies:
115
+ ```bash
116
+ pip install -e ".[dev]"
117
+ ```
118
+
119
+ Run all tests:
120
+ ```bash
121
+ pytest
122
+ ```
123
+
124
+ Run tests with coverage:
125
+ ```bash
126
+ pytest --cov=ethoscopy --cov-report=term-missing
127
+ ```
128
+
129
+ Or use the convenience script:
130
+ ```bash
131
+ python run_tests.py
132
+ ```
133
+
134
+ ### Test Categories
135
+
136
+ - **Unit tests**: Fast tests for individual functions (`pytest -m unit`)
137
+ - **Integration tests**: Workflow testing (`pytest -m integration`)
138
+ - **Performance tests**: Long-running tests (`pytest -m slow`)
139
+
140
+ For detailed testing information, see [TESTING.md](TESTING.md).
141
+
62
142
  ## License
63
143
 
64
- This project is licensed under the [GNU-3 license](LICENSE)
144
+ This project is licensed under the [GNU-3 license](LICENSE)