PyTDLM 0.1.0__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.
- pytdlm-0.1.0/.github/workflows/publish.yml +120 -0
- pytdlm-0.1.0/.github/workflows/test-builds.yml +156 -0
- pytdlm-0.1.0/.github/workflows/test-examples.yml +53 -0
- pytdlm-0.1.0/.gitignore +85 -0
- pytdlm-0.1.0/LICENSE +674 -0
- pytdlm-0.1.0/MANIFEST.in +9 -0
- pytdlm-0.1.0/PKG-INFO +141 -0
- pytdlm-0.1.0/PyTDLM.egg-info/PKG-INFO +141 -0
- pytdlm-0.1.0/PyTDLM.egg-info/SOURCES.txt +23 -0
- pytdlm-0.1.0/PyTDLM.egg-info/dependency_links.txt +1 -0
- pytdlm-0.1.0/PyTDLM.egg-info/requires.txt +15 -0
- pytdlm-0.1.0/PyTDLM.egg-info/top_level.txt +1 -0
- pytdlm-0.1.0/README.md +102 -0
- pytdlm-0.1.0/TDLM/__init__.py +24 -0
- pytdlm-0.1.0/TDLM/tdlm.py +821 -0
- pytdlm-0.1.0/docs/examples/basic_usage.py +181 -0
- pytdlm-0.1.0/docs/examples/data_US/Distance.csv.gz +0 -0
- pytdlm-0.1.0/docs/examples/data_US/Inputs.csv +3109 -0
- pytdlm-0.1.0/docs/examples/data_US/OD.csv +3109 -0
- pytdlm-0.1.0/environment.yml +16 -0
- pytdlm-0.1.0/meta.yaml +45 -0
- pytdlm-0.1.0/pyproject.toml +58 -0
- pytdlm-0.1.0/setup.cfg +4 -0
- pytdlm-0.1.0/tests/__init__.py +3 -0
- pytdlm-0.1.0/tests/test_tdlm.py +217 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
name: Publish Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish-pypi:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
if: github.event_name == 'release'
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Set up Python
|
|
16
|
+
uses: actions/setup-python@v4
|
|
17
|
+
with:
|
|
18
|
+
python-version: '3.9'
|
|
19
|
+
|
|
20
|
+
- name: Install build dependencies
|
|
21
|
+
run: |
|
|
22
|
+
python -m pip install --upgrade pip
|
|
23
|
+
python -m pip install build twine
|
|
24
|
+
|
|
25
|
+
- name: Build package
|
|
26
|
+
run: python -m build
|
|
27
|
+
|
|
28
|
+
- name: Check package
|
|
29
|
+
run: twine check dist/*
|
|
30
|
+
|
|
31
|
+
- name: Publish to PyPI
|
|
32
|
+
env:
|
|
33
|
+
TWINE_USERNAME: __token__
|
|
34
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
35
|
+
run: twine upload dist/*
|
|
36
|
+
|
|
37
|
+
prepare-conda-forge-info:
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
if: github.event_name == 'release'
|
|
40
|
+
needs: publish-pypi
|
|
41
|
+
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@v4
|
|
44
|
+
|
|
45
|
+
- name: Set up Miniconda
|
|
46
|
+
uses: conda-incubator/setup-miniconda@v2
|
|
47
|
+
with:
|
|
48
|
+
auto-update-conda: true
|
|
49
|
+
python-version: '3.9'
|
|
50
|
+
channels: conda-forge,defaults
|
|
51
|
+
|
|
52
|
+
- name: Install grayskull (conda recipe generator)
|
|
53
|
+
shell: bash -l {0}
|
|
54
|
+
run: |
|
|
55
|
+
conda install -c conda-forge grayskull -y
|
|
56
|
+
|
|
57
|
+
- name: Generate conda-forge recipe with grayskull
|
|
58
|
+
shell: bash -l {0}
|
|
59
|
+
run: |
|
|
60
|
+
# Wait a bit for PyPI to be available
|
|
61
|
+
sleep 60
|
|
62
|
+
grayskull pypi TDLM
|
|
63
|
+
|
|
64
|
+
- name: Upload generated recipe
|
|
65
|
+
uses: actions/upload-artifact@v3
|
|
66
|
+
with:
|
|
67
|
+
name: conda-forge-recipe
|
|
68
|
+
path: TDLM/
|
|
69
|
+
|
|
70
|
+
- name: Comment on release with conda-forge instructions
|
|
71
|
+
uses: actions/github-script@v6
|
|
72
|
+
with:
|
|
73
|
+
script: |
|
|
74
|
+
const fs = require('fs');
|
|
75
|
+
const path = require('path');
|
|
76
|
+
|
|
77
|
+
// Try to read the generated meta.yaml for reference
|
|
78
|
+
let recipeContent = '';
|
|
79
|
+
try {
|
|
80
|
+
recipeContent = fs.readFileSync('TDLM/meta.yaml', 'utf8');
|
|
81
|
+
} catch (error) {
|
|
82
|
+
recipeContent = 'Recipe generation failed - use manual meta.yaml';
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
github.rest.issues.createComment({
|
|
86
|
+
issue_number: context.payload.release.id,
|
|
87
|
+
owner: context.repo.owner,
|
|
88
|
+
repo: context.repo.repo,
|
|
89
|
+
body: `🎉 Release ${context.payload.release.tag_name} published!
|
|
90
|
+
|
|
91
|
+
## Distribution Status
|
|
92
|
+
|
|
93
|
+
✅ **PyPI:** Available at https://pypi.org/project/TDLM/${context.payload.release.tag_name}/
|
|
94
|
+
|
|
95
|
+
## Conda-forge Next Steps
|
|
96
|
+
|
|
97
|
+
### If this is your FIRST conda-forge submission:
|
|
98
|
+
1. Fork https://github.com/conda-forge/staged-recipes
|
|
99
|
+
2. Create \`recipes/tdlm/meta.yaml\` using the generated recipe (see artifacts)
|
|
100
|
+
3. Submit PR to staged-recipes
|
|
101
|
+
4. After merge, conda-forge will create your feedstock
|
|
102
|
+
|
|
103
|
+
### If feedstock already exists:
|
|
104
|
+
The conda-forge bot should automatically detect this PyPI release and create an update PR to your feedstock.
|
|
105
|
+
|
|
106
|
+
**Generated conda recipe is available in the workflow artifacts above.**
|
|
107
|
+
|
|
108
|
+
**Feedstock location (after initial submission):** https://github.com/conda-forge/tdlm-feedstock`
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
- name: Check if conda-forge feedstock exists
|
|
112
|
+
continue-on-error: true
|
|
113
|
+
run: |
|
|
114
|
+
# This will help identify if the feedstock already exists
|
|
115
|
+
curl -f -s https://api.github.com/repos/conda-forge/tdlm-feedstock > /dev/null
|
|
116
|
+
if [ $? -eq 0 ]; then
|
|
117
|
+
echo "Feedstock exists - conda-forge bot should auto-update"
|
|
118
|
+
else
|
|
119
|
+
echo "Feedstock does not exist - manual submission to staged-recipes needed"
|
|
120
|
+
fi
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
name: Test Build and Distribution
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, develop ]
|
|
8
|
+
release:
|
|
9
|
+
types: [published]
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test-pip-build:
|
|
13
|
+
runs-on: ${{ matrix.os }}
|
|
14
|
+
strategy:
|
|
15
|
+
fail-fast: false
|
|
16
|
+
matrix:
|
|
17
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
18
|
+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
24
|
+
uses: actions/setup-python@v4
|
|
25
|
+
with:
|
|
26
|
+
python-version: ${{ matrix.python-version }}
|
|
27
|
+
|
|
28
|
+
- name: Install build dependencies
|
|
29
|
+
run: |
|
|
30
|
+
python -m pip install --upgrade pip
|
|
31
|
+
python -m pip install build twine wheel setuptools
|
|
32
|
+
|
|
33
|
+
- name: Build package
|
|
34
|
+
run: python -m build
|
|
35
|
+
|
|
36
|
+
- name: Check package with twine
|
|
37
|
+
shell: bash # Required for Windows, otherwise glob pattern will fail
|
|
38
|
+
run: twine check dist/*
|
|
39
|
+
|
|
40
|
+
- name: Install package from wheel
|
|
41
|
+
shell: bash # Required for Windows, otherwise glob pattern will fail
|
|
42
|
+
run: pip install dist/*.whl
|
|
43
|
+
|
|
44
|
+
- name: Test import
|
|
45
|
+
run: |
|
|
46
|
+
python -c "from TDLM import tdlm; print('TDLM imported successfully')"
|
|
47
|
+
python -c "import TDLM; print(f'TDLM version: {TDLM.__version__}')"
|
|
48
|
+
|
|
49
|
+
- name: Run basic tests
|
|
50
|
+
run: |
|
|
51
|
+
pip install pytest pytest-cov
|
|
52
|
+
pytest tests/ -v
|
|
53
|
+
|
|
54
|
+
- name: Upload pip artifacts
|
|
55
|
+
uses: actions/upload-artifact@v4
|
|
56
|
+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
|
|
57
|
+
with:
|
|
58
|
+
name: pip-dist
|
|
59
|
+
path: dist/
|
|
60
|
+
|
|
61
|
+
test-conda-build:
|
|
62
|
+
runs-on: ${{ matrix.os }}
|
|
63
|
+
strategy:
|
|
64
|
+
fail-fast: false
|
|
65
|
+
matrix:
|
|
66
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
67
|
+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
|
|
68
|
+
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@v4
|
|
71
|
+
|
|
72
|
+
- name: Set up Miniconda
|
|
73
|
+
uses: conda-incubator/setup-miniconda@v2
|
|
74
|
+
with:
|
|
75
|
+
auto-update-conda: true
|
|
76
|
+
python-version: ${{ matrix.python-version }}
|
|
77
|
+
channels: conda-forge,defaults
|
|
78
|
+
channel-priority: strict
|
|
79
|
+
miniconda-version: "latest"
|
|
80
|
+
|
|
81
|
+
- name: Install conda-build
|
|
82
|
+
shell: bash -l {0}
|
|
83
|
+
run: |
|
|
84
|
+
conda install conda-build
|
|
85
|
+
|
|
86
|
+
- name: Build conda package
|
|
87
|
+
shell: bash -l {0}
|
|
88
|
+
run: |
|
|
89
|
+
conda build . --output-folder conda-dist
|
|
90
|
+
|
|
91
|
+
- name: Test conda package installation
|
|
92
|
+
shell: bash -l {0}
|
|
93
|
+
run: |
|
|
94
|
+
# Create a fresh environment and install the package
|
|
95
|
+
conda create -n test-env python=${{ matrix.python-version }} -y
|
|
96
|
+
conda activate test-env
|
|
97
|
+
conda install -c ./conda-dist tdlm -y
|
|
98
|
+
|
|
99
|
+
- name: Test conda package import
|
|
100
|
+
shell: bash -l {0}
|
|
101
|
+
run: |
|
|
102
|
+
conda activate test-env
|
|
103
|
+
python -c "from TDLM import tdlm; print('TDLM imported successfully')"
|
|
104
|
+
python -c "import TDLM; print(f'TDLM version: {TDLM.__version__}')"
|
|
105
|
+
|
|
106
|
+
- name: Run tests in conda environment
|
|
107
|
+
shell: bash -l {0}
|
|
108
|
+
run: |
|
|
109
|
+
conda activate test-env
|
|
110
|
+
conda install pytest pytest-cov -y
|
|
111
|
+
pytest tests/ -v
|
|
112
|
+
|
|
113
|
+
- name: Upload conda artifacts
|
|
114
|
+
uses: actions/upload-artifact@v4
|
|
115
|
+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
|
|
116
|
+
with:
|
|
117
|
+
name: conda-dist
|
|
118
|
+
path: conda-dist/
|
|
119
|
+
|
|
120
|
+
test-environment-yml:
|
|
121
|
+
runs-on: ubuntu-latest
|
|
122
|
+
needs: test-conda-build # ensures the conda build job completes before this job runs
|
|
123
|
+
steps:
|
|
124
|
+
- uses: actions/checkout@v4
|
|
125
|
+
|
|
126
|
+
- name: Set up Miniconda
|
|
127
|
+
uses: conda-incubator/setup-miniconda@v2
|
|
128
|
+
with:
|
|
129
|
+
auto-update-conda: true
|
|
130
|
+
python-version: 3.9
|
|
131
|
+
channels: conda-forge,defaults
|
|
132
|
+
|
|
133
|
+
- name: Create environment from environment.yml
|
|
134
|
+
shell: bash -l {0}
|
|
135
|
+
run: |
|
|
136
|
+
conda env create -f environment.yml
|
|
137
|
+
|
|
138
|
+
- name: Test environment
|
|
139
|
+
shell: bash -l {0}
|
|
140
|
+
run: |
|
|
141
|
+
conda activate tdlm
|
|
142
|
+
python -c "import numpy, pandas, tabulate, tqdm; print('All dependencies imported successfully')"
|
|
143
|
+
|
|
144
|
+
# Install the pre-built conda package
|
|
145
|
+
PACKAGE_PATH=$(find conda-dist -name "*.tar.bz2" | head -1)
|
|
146
|
+
echo "Installing package: $PACKAGE_PATH"
|
|
147
|
+
conda install $PACKAGE_PATH -y
|
|
148
|
+
python -c "from TDLM import tdlm; print('TDLM imported successfully')"
|
|
149
|
+
python -c "import TDLM; print(f'TDLM version: {TDLM.__version__}')"
|
|
150
|
+
|
|
151
|
+
- name: Run tests in conda environment
|
|
152
|
+
shell: bash -l {0}
|
|
153
|
+
run: |
|
|
154
|
+
conda activate tdlm
|
|
155
|
+
pytest tests/ -v
|
|
156
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
name: Test Examples
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, develop ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test-basic-usage:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Set up Python
|
|
16
|
+
uses: actions/setup-python@v4
|
|
17
|
+
with:
|
|
18
|
+
python-version: '3.9'
|
|
19
|
+
|
|
20
|
+
- name: Install package and dependencies with pip
|
|
21
|
+
run: |
|
|
22
|
+
python -m pip install --upgrade pip
|
|
23
|
+
pip install -e .
|
|
24
|
+
pip install matplotlib # Needed for example
|
|
25
|
+
|
|
26
|
+
- name: Test basic usage example with pip
|
|
27
|
+
run: |
|
|
28
|
+
cd docs/examples
|
|
29
|
+
python basic_usage.py
|
|
30
|
+
|
|
31
|
+
- name: Set up Miniconda for conda test
|
|
32
|
+
uses: conda-incubator/setup-miniconda@v2
|
|
33
|
+
with:
|
|
34
|
+
auto-update-conda: true
|
|
35
|
+
python-version: '3.9'
|
|
36
|
+
environment-file: environment.yml
|
|
37
|
+
activate-environment: tdlm
|
|
38
|
+
|
|
39
|
+
- name: Build and test with conda
|
|
40
|
+
shell: bash -l {0}
|
|
41
|
+
run: |
|
|
42
|
+
conda activate tdlm
|
|
43
|
+
conda install matplotlib conda-build -y
|
|
44
|
+
|
|
45
|
+
# Build the conda package
|
|
46
|
+
conda build . --output-folder conda-dist
|
|
47
|
+
|
|
48
|
+
# Install the built package
|
|
49
|
+
conda install -c ./conda-dist tdlm -y
|
|
50
|
+
|
|
51
|
+
# Test the example
|
|
52
|
+
cd docs/examples
|
|
53
|
+
python basic_usage.py
|
pytdlm-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
pip-wheel-metadata/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
*.manifest
|
|
32
|
+
*.spec
|
|
33
|
+
|
|
34
|
+
# Installer logs
|
|
35
|
+
pip-log.txt
|
|
36
|
+
pip-delete-this-directory.txt
|
|
37
|
+
|
|
38
|
+
# Unit test / coverage reports
|
|
39
|
+
htmlcov/
|
|
40
|
+
.tox/
|
|
41
|
+
.nox/
|
|
42
|
+
.coverage
|
|
43
|
+
.coverage.*
|
|
44
|
+
.cache
|
|
45
|
+
nosetests.xml
|
|
46
|
+
coverage.xml
|
|
47
|
+
*.cover
|
|
48
|
+
*.py,cover
|
|
49
|
+
.hypothesis/
|
|
50
|
+
.pytest_cache/
|
|
51
|
+
|
|
52
|
+
# Jupyter Notebook
|
|
53
|
+
.ipynb_checkpoints
|
|
54
|
+
|
|
55
|
+
# IPython
|
|
56
|
+
profile_default/
|
|
57
|
+
ipython_config.py
|
|
58
|
+
|
|
59
|
+
# pyenv
|
|
60
|
+
.python-version
|
|
61
|
+
|
|
62
|
+
# conda environments
|
|
63
|
+
.conda/
|
|
64
|
+
.env
|
|
65
|
+
.venv
|
|
66
|
+
env/
|
|
67
|
+
venv/
|
|
68
|
+
ENV/
|
|
69
|
+
env.bak/
|
|
70
|
+
venv.bak/
|
|
71
|
+
|
|
72
|
+
# mypy
|
|
73
|
+
.mypy_cache/
|
|
74
|
+
.dmypy.json
|
|
75
|
+
dmypy.json
|
|
76
|
+
|
|
77
|
+
# IDE
|
|
78
|
+
.vscode/
|
|
79
|
+
.idea/
|
|
80
|
+
*.swp
|
|
81
|
+
*.swo
|
|
82
|
+
|
|
83
|
+
# OS
|
|
84
|
+
.DS_Store
|
|
85
|
+
Thumbs.db
|