# traclus_impl
### Purpose This is a Python implementation of the Traclus algorithm. It works for 2-D trajectories. Note that this was written as a piece of a senior project. This traclus implementation should functionally work, but it is currently slow on larger sets of trajectories.
### Install The easiest way to install is with pip install traclus_impl.
### Usage To run the Traclus algorithm, run traclus_impl.main.py, passing it the name of an input file and output file. The input file contains a json object with parameters to traclus and the raw trajectories. See “traclus_impl.integ_tests.raw_campus_trajectories.txt” for an example input file. The output file will contain a json list of representative trajectories. Optionally, provide names of files to dump the output from the partitioning and clustering stages to.
Example: navigate to directory where traclus_impl.main.py is and run “python main.py -i ./raw_traj_input -o ./traclus_output
Note that the actual entry point function of the real computation is “run_traclus” in traclus_impl.coordination.py. The “run_traclus” function takes Traclus arguments and a list of trajectories. The list of trajectories input to “run_traclus” is a list of traclus_impl.geometry.Point objects, and it returns a list of representative line segments as this same type of object.
main.py only parses arguments to traclus, calls run_traclus, and writes them to a file. It is mostly just an example of a way to use the “run_traclus” function.
The best example of complete usage is the test in “traclus_impl.integ_tests.campus_trajectories_processing_test.py”.
### Intermediate output hooks ### The “run_traclus” function in traclus_impl.coordination.py optionally takes hooks for the output of the partitioning stage and clustering stage. The hook functions for these in main.py and the “traclus_impl.integ_tests.campus_trajectories_processing_test.py” tests show some example usage.
### Running the tests. Tests exist under the traclus_impl.tests and traclus_impl.integ_tests. To run all of the tests from the commandline, navigate to the package’s root and run: python -m unittest discover -p “_test.py”
### Notes on Performance ### * Currently, the main bottleneck seems to be the quadratic clustering, and future work includes improving this. For some larger trajectory sets such as the elk file under integ_tests/deer_tests, this implementation will take a very long time. * traclus_impl.integ_tests.deer_tests.run_traclus.py is mostly used for profiling this traclus implementation on the trajectories in that folder.
Metadata
Release files for traclus_impl 0.9.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| traclus_impl-0.9.5.zip | 478.9 kB | Without provenance | Details |
Release files / traclus_impl-0.9.5.zip
| Download URL | traclus_impl-0.9.5.zip |
|---|---|
| Size | 478.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ceea5fd68ee8938ca6a21a9e669804767a0cfdffba3d6c6b98cd3eb4224ba91
|
|
BLAKE2b-256 checksum How to use checksums |
a557fd30bee41fc66e7d8a263b69c8841357e3447e3563ea0cb683b98e58ec97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for traclus_impl 0.9.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.