Skip to main content

No project description provided

Project description

RustSim

  • Setup your virtual environment of choice.
  • cd rustsim (home directory of this project)
  • pip install maturin
  • maturin develop
  • python
Python 3.9.16 (main, Jan 11 2023, 10:02:19) 
[Clang 14.0.6 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import rustsim
>>> rustsim.run("tests/data/test_set.tsv", "tests/data/closures.tsv")

should yield

TermSetPairwiseSimilarity {
    set_id: "set3",
    original_subject_termset: {
        "apple",
        "orange",
        "banana",
    },
    subject_termset: {
        "fruit",
        "orange",
        "apple",
        "tropical",
        "banana",
    },
    original_object_termset: {
        "mango",
        "banana",
        "cheese",
        "papaya",
        "beef",
    },
    object_termset: {
        "mango",
        "fruit",
        "papaya",
        "banana",
        "cheese",
        "beef",
        "meat",
        "dairy",
        "tropical",
    },
    jaccard_similarity: 0.2727272727272727,
}
TermSetPairwiseSimilarity {
    set_id: "set1",
    original_subject_termset: {
        "apple",
        "orange",
        "banana",
    },
    subject_termset: {
        "fruit",
        "orange",
        "apple",
        "tropical",
        "banana",
    },
    original_object_termset: {
        "apple",
        "orange",
        "banana",
    },
    object_termset: {
        "orange",
        "banana",
        "apple",
        "tropical",
        "fruit",
    },
    jaccard_similarity: 1.0,
}
TermSetPairwiseSimilarity {
    set_id: "set2",
    original_subject_termset: {
        "apple",
        "orange",
        "banana",
    },
    subject_termset: {
        "fruit",
        "orange",
        "apple",
        "tropical",
        "banana",
    },
    original_object_termset: {
        "mango",
        "apple",
        "papaya",
    },
    object_termset: {
        "apple",
        "fruit",
        "papaya",
        "mango",
        "tropical",
    },
    jaccard_similarity: 0.42857142857142855,
}

Troubleshooting

Building for Mac ARM M1 architectures

If a import rustsim results in a ImportError warning about incompatible architecture, try the following:

  • Install conda. This guide may be helpful.
  • Set up a virtual environment with conda so that your Python build is aligned with your processor architecture (in this case, ARM). Try something like:
$ conda create -n myenv python=3.9
...setup happens...
$ conda activate myenv

and then proceed as above.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

rustsim-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

rustsim-0.1.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (587.9 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

rustsim-0.1.2-cp310-cp310-macosx_10_7_x86_64.whl (298.7 kB view hashes)

Uploaded CPython 3.10 macOS 10.7+ x86-64

rustsim-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

rustsim-0.1.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (588.9 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

rustsim-0.1.2-cp39-cp39-macosx_10_7_x86_64.whl (299.1 kB view hashes)

Uploaded CPython 3.9 macOS 10.7+ x86-64

rustsim-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

rustsim-0.1.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (588.3 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

rustsim-0.1.2-cp38-cp38-macosx_10_7_x86_64.whl (299.1 kB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

rustsim-0.1.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

rustsim-0.1.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (588.3 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

rustsim-0.1.2-cp37-cp37m-macosx_10_7_x86_64.whl (299.1 kB view hashes)

Uploaded CPython 3.7m macOS 10.7+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page