Follow these instructions to install and use ProbabilisticCircuits.jl as a developer of the package.
Install the Julia package in development mode by running
julia -e 'using Pkg; Pkg.develop(PackageSpec(url="https://github.com/Tractables/ProbabilisticCircuits.jl.git"))'
By default this will install the package at ~/.julia/dev
and allow you to change the code there. See the Pkg manual for more details. One can adjust the development directory using environment variables or simply create a symbolic link to/from your favorite development directory.
Depending on your usecase you might also want to have LogicCircuits.jl
in develop mode, in that case run the following to do both:
julia -e 'using Pkg; Pkg.develop([PackageSpec(url="https://github.com/Tractables/LogicCircuits.jl.git"),PackageSpec(url="https://github.com/Tractables/ProbabilisticCircuits.jl.git")])'
Set the following environment variable, to automatically download data artifacts needed during tests without user input. Otherwise the tests would fail if the artifact is not already downloaded.
export DATADEPS_ALWAYS_ACCEPT=1
Additionally, if you want the tests to run faster, you can use more cores by setting the following variable. The default value is 1.
export JIVE_PROCS=8
Make sure to run the tests before commiting new code.
To run all the tests:
JIVE_PROCS=8 julia --project=test --color=yes test/runtests.jl
You can also run a specific test:
julia --project=test --color=yes test/parameters_tests.jl
Only do this for when the repo is in stable position, and we have decent amount of changes from previous version.
- As much as possible, make sure to first release a new version for
LogicCircuits.jl
. - Bump up the version in
Project.toml
- Use Julia Registrator to submit a pull request to julia's public registry.
- The web interface seems to be the easiest. Follow the instructions in the generated pull request and make sure there is no errors. For example this pull request.
- Github Release. TagBot is enabled for this repo, so after the registrator merges the pull request, TagBot automatically does a github release in sync with the registrar's new version.
- Note: TagBot would automatically include all the closed PRs and issues since the previous version in the release note, if you want to exclude some of them, refer to Julia TagBot docs.
The example is for Circuit Model Zoo, but should work for others:
- Push new updates to UCLA-StarAI/Circuit-Model-Zoo
- Do a new zoo release.
- Update the
LogicCircuits.jl
'sArtifact.toml
file with new git tag and hash. Example commit can be found here. - Do the same for
ProbabilisticCircuits.jl
'sArtifact.toml
file. Example commit here. - Note that for each Artifact.toml, 2 things need to change:
git-tree-sha1
andsha256
. - Update the
const zoo_version = "/Circuit-Model-Zoo-0.1.4"
inside LogicCircuits.jl to the new zoo version. No changes needed in ProbabilisticCircuits since it uses the same constant.
Download the new Zoo release from Github. Now you can use the following code snippet to get the hashes (check the julia Artifact page for latest instructions):
using Tar, Inflate, SHA
filename = "socrates.tar.gz"
println("sha256: ", bytes2hex(open(sha256, filename)))
println("git-tree-sha1: ", Tar.tree_hash(IOBuffer(inflate_gzip(filename))))