diff --git a/README.md b/README.md index 7920c2a0cd4cf98ad226ccd8eee9c932cee246d2..474c565627241758647581ba9678616998488d63 100644 --- a/README.md +++ b/README.md @@ -14,19 +14,36 @@ The idea behind it is to keep the *logic* of user submissions rather than the ex -## Usage +## Installation +Installation with `pip` without cloning: +```terminal +pip install git+https://gitlab.irit.fr/sepia-pub/mael/swf2userSessions +``` + +Clone and install with `flit`: +```terminal +git clone https://gitlab.irit.fr/sepia-pub/mael/swf2userSessions +cd swf2userSessions +flit install +``` + +You can then run the app from CLI by simply calling `swf2userSessions`. + +You can also clone the repository and directly execute the main script `python3 swf2userSessions/swf2sessions.py`. + Requirements: - python3 - [networkx](https://github.com/networkx/networkx) (optional, for the graph outputs): `pip3 install networkx` - [pytest](https://pytest.org/) (optional, for the tests): `pip3 install pytest` +## Usage To run the session decomposition on the workload `workloads/example.swf` illustrated above, with "Arrival" delimitation approach and a threshold of 60 minutes: ```terminal -python3 swf2userSessions.py -a 60 workloads/example.swf out/ +swf2userSessions -a 60 workloads/example.swf out/ ``` -For more documentation, see: `python3 swf2userSessions.py -h` +For more documentation, see: `swf2userSessions -h` ## Example diff --git a/pyproject.toml b/pyproject.toml index 75fbea16d0ebc19372a9cd9e7ac9d421133be6fb..22233ecaf1780c53f20b5bf3178273fd3563d9e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,4 +18,4 @@ classifiers = [ ] [project.scripts] -swf2userSessions = "swf2userSessions.swf2userSessions:parse_from_cli" \ No newline at end of file +swf2userSessions = "swf2userSessions.swf2sessions:parse_from_cli" \ No newline at end of file diff --git a/swf2userSessions/swf2userSessions.py b/swf2userSessions/swf2sessions.py similarity index 99% rename from swf2userSessions/swf2userSessions.py rename to swf2userSessions/swf2sessions.py index 53486b265d1bf0c27c8a82510179062fa396cfd5..a90910954cb67153b3d15520a14f88afdabeb5fd 100755 --- a/swf2userSessions/swf2userSessions.py +++ b/swf2userSessions/swf2sessions.py @@ -232,4 +232,4 @@ def parse_from_cli(): if __name__ == "__main__": - main() \ No newline at end of file + parse_from_cli() \ No newline at end of file diff --git a/test/conftest.py b/test/conftest.py index e844f1a6b6ccce69b3409943581a7c607027569f..b074361ece6fea5cfc25e9e514789770da20c39a 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -30,7 +30,7 @@ def run_script(delim, threshold, out_dir = os.path.abspath(f'test-out/{test_name}') create_dir_rec_if_needed(out_dir) - args = ['python3', 'swf2userSessions.py', f'--{delim}', str(threshold), + args = ['python3', 'swf2userSessions/swf2sessions.py', f'--{delim}', str(threshold), '-q', input_swf, out_dir] if graph: args.append("--graph")