Merge branch 'trajectory-generation' of https://github.com/pietroepis/PyCTBN into trajectory-generation
commit
b648d52671
@ -0,0 +1,3 @@ |
||||
*.js linguist-vendored |
||||
*.html linguist-vendored |
||||
*.css linguist-vendored |
@ -0,0 +1,67 @@ |
||||
|
||||
on: |
||||
push: |
||||
# Sequence of patterns matched against refs/tags |
||||
tags: |
||||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 |
||||
|
||||
name: Upload Release Asset |
||||
|
||||
jobs: |
||||
build: |
||||
|
||||
runs-on: ubuntu-latest |
||||
strategy: |
||||
matrix: |
||||
python-version: [3.8] |
||||
|
||||
name: Upload Release Asset |
||||
steps: |
||||
- uses: actions/checkout@v2 |
||||
- name: Set up Python ${{ matrix.python-version }} |
||||
uses: actions/setup-python@v2 |
||||
with: |
||||
python-version: ${{ matrix.python-version }} |
||||
- name: Install dependencies |
||||
run: | |
||||
python -m pip install --upgrade pip |
||||
python -m pip install flake8 pytest |
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
||||
- name: Lint with flake8 |
||||
run: | |
||||
# stop the build if there are Python syntax errors or undefined names |
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
||||
- name: Test with pytest |
||||
run: | |
||||
pytest PyCTBN/tests/ |
||||
- name: Install dependencies |
||||
run: | |
||||
python -m pip install --upgrade pip |
||||
python -m pip install flake8 pytest |
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
||||
- name: Install pypa/build |
||||
run: | |
||||
python -m pip install build |
||||
- name: Build project # This would actually build your project, using zip for an example artifact |
||||
run: | |
||||
python -m build --sdist --wheel --outdir dist/. |
||||
- name: Create Release |
||||
id: create_release |
||||
uses: actions/create-release@v1 |
||||
env: |
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
||||
with: |
||||
tag_name: ${{ github.ref }} |
||||
release_name: Release ${{ github.ref }} |
||||
draft: false |
||||
prerelease: false |
||||
- name: Upload Release Asset |
||||
id: upload-release-asset |
||||
uses: dwenegar/upload-release-assets@v1 |
||||
env: |
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
||||
with: |
||||
release_id: ${{ steps.create_release.outputs.id }} |
||||
assets_path: ./dist |
@ -0,0 +1,21 @@ |
||||
MIT License |
||||
|
||||
Copyright (c) 2021 MADLabUnimib developers |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
of this software and associated documentation files (the "Software"), to deal |
||||
in the Software without restriction, including without limitation the rights |
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
copies of the Software, and to permit persons to whom the Software is |
||||
furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included in all |
||||
copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||||
SOFTWARE. |
@ -1,3 +1,6 @@ |
||||
|
||||
# License: MIT License |
||||
|
||||
from .optimizer import Optimizer |
||||
from .tabu_search import TabuSearch |
||||
from .hill_climbing_search import HillClimbing |
||||
|
@ -1,3 +1,6 @@ |
||||
|
||||
# License: MIT License |
||||
|
||||
from .abstract_importer import AbstractImporter |
||||
from .cache import Cache |
||||
from .json_importer import JsonImporter |
||||
|
@ -1,2 +1,5 @@ |
||||
|
||||
# License: MIT License |
||||
|
||||
import PyCTBN.PyCTBN |
||||
from PyCTBN.PyCTBN import * |
||||
|
@ -1,39 +0,0 @@ |
||||
import glob |
||||
import os |
||||
|
||||
import sys |
||||
sys.path.append("./PyCTBN/") |
||||
|
||||
import structure_graph.network_graph as ng |
||||
import structure_graph.sample_path as sp |
||||
import structure_graph.set_of_cims as sofc |
||||
import estimators.parameters_estimator as pe |
||||
import utility.json_importer as ji |
||||
|
||||
|
||||
def main(): |
||||
read_files = glob.glob(os.path.join('./data', "*.json")) #Take all json files in this dir |
||||
#import data |
||||
importer = ji.JsonImporter(read_files[0], 'samples', 'dyn.str', 'variables', 'Time', 'Name') |
||||
#Create a SamplePath Obj |
||||
s1 = sp.SamplePath(importer) |
||||
#Build The trajectries and the structural infos |
||||
s1.build_trajectories() |
||||
s1.build_structure() |
||||
#From The Structure Object build the Graph |
||||
g = ng.NetworkGraph(s1.structure) |
||||
#Select a node you want to estimate the parameters |
||||
node = g.nodes[1] |
||||
#Init the graph specifically for THIS node |
||||
g.fast_init(node) |
||||
#Use SamplePath and Grpah to create a ParametersEstimator Object |
||||
p1 = pe.ParametersEstimator(s1, g) |
||||
#Init the peEst specifically for THIS node |
||||
p1.fast_init(node) |
||||
#Compute the parameters |
||||
sofc1 = p1.compute_parameters_for_node(node) |
||||
#The est CIMS are inside the resultant SetOfCIms Obj |
||||
print(sofc1.actual_cims) |
||||
|
||||
if __name__ == "__main__": |
||||
main() |
@ -1,20 +0,0 @@ |
||||
from setuptools import setup, find_packages |
||||
|
||||
|
||||
setup(name='PyCTBN', |
||||
version='1.0', |
||||
url='https://github.com/philipMartini/PyCTBN', |
||||
license='MIT', |
||||
author=['Alessandro Bregoli', 'Filippo Martini','Luca Moretti'], |
||||
author_email=['a.bregoli1@campus.unimib.it', 'f.martini@campus.unimib.it','lucamoretti96@gmail.com'], |
||||
description='A Continuous Time Bayesian Networks Library', |
||||
packages=find_packages('.', exclude=['tests']), |
||||
#packages=['PyCTBN.PyCTBN'], |
||||
install_requires=[ |
||||
'numpy', 'pandas', 'networkx', 'scipy', 'matplotlib', 'tqdm'], |
||||
dependency_links=['https://github.com/numpy/numpy', 'https://github.com/pandas-dev/pandas', |
||||
'https://github.com/networkx/networkx', 'https://github.com/scipy/scipy', |
||||
'https://github.com/tqdm/tqdm'], |
||||
#long_description=open('../README.md').read(), |
||||
zip_safe=False, |
||||
python_requires='>=3.6') |
@ -1 +1,4 @@ |
||||
|
||||
# License: MIT License |
||||
|
||||
|
||||
|
@ -0,0 +1 @@ |
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,4 +1,4 @@ |
||||
# Sphinx build info version 1 |
||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. |
||||
config: b22e9cd1b245962cc8b033cb6fcce1d2 |
||||
config: 481da5f157a263da657ebbabcd85e902 |
||||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
||||
|
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 15 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in new issue