Installation
CompactObject is an open-source package designed for comprehensive neutron star EOS inference. It is built to be easy to install and use. Follow the step-by-step installation guide below to get started.
Using Python Virtual Environment (Recommended)
If you are not using Anaconda, you can create a virtual environment using Python’s venv
module:
Step 1: Create a Virtual Environment
Run the following command to create a virtual environment named CompactObject
:
python3 -m venv CompactObject
You can specify a different path by replacing ``CompactObject`` with your desired directory name.
Step 2: Activate the Environment
Activate the virtual environment with:
source CompactObject/bin/activate
Step 3: Install the CompactObject Package
Once the environment is activated, you can install the package from PyPI, which is called CompactObject-TOV
:
pip install CompactObject-TOV
The dependencies should be automatically installed for you.
Alternative Installation Method
If you encounter issues using pip install
, you can install the package manually:
Clone the Repository
Clone the CompactObject repository:
git clone https://github.com/ChunHuangPhy/CompactObject.git
Install the Required Dependencies
Navigate to the repository directory and install the dependencies:
pip install -r requirements.txt
Install the CompactObject Package
Install the package in editable mode:
pip install -e .
To upgrade to the latest version on PyPI, run:
pip install CompactObject-TOV --upgrade
Step 4: Using the Package
You are now ready to use CompactObject. Each time you want to use the package, ensure you activate the environment:
source CompactObject/bin/activate
Alternative: Using Anaconda
Step 1: Create a Virtual Environment
You can also create a virtual environment for CompactObject using Anaconda:
conda create -n CompactObject
When prompted to proceed, type y
and press Enter.
Step 2: Activate the Environment
Activate your newly created environment with the following command:
conda activate CompactObject
Note: Once you create this environment, you don’t need to create it again. Simply activate it whenever you want to use CompactObject.
Step 3: Install the CompactObject Package
Once the environment is activated, you can install the package from PyPI:
pip install CompactObject-TOV
The dependencies should be automatically installed for you.
Alternative Installation Method
If you encounter issues using pip install
, you can install the package manually:
Clone the Repository
Clone the CompactObject repository:
git clone https://github.com/ChunHuangPhy/CompactObject.git
Install the Required Dependencies
Navigate to the repository directory and install the dependencies:
pip install -r requirements.txt
Install the CompactObject Package
Install the package in editable mode:
pip install -e .
To upgrade to the latest version on PyPI, run:
pip install CompactObject-TOV --upgrade
Step 4: You’re Ready to Use CompactObject!
Whenever you want to use this package, remember to activate the environment first:
conda activate CompactObject
By following these instructions, you should have CompactObject installed and ready to use. If you encounter any issues during installation, please refer to the project’s documentation or seek assistance from the community.
CompactObject-TOV optionally depends on numbaminpack. However, it may hard to install if don’t have a fortran complier. Please refer to this page NumbaMinpack documentation, and you can skip this dependency if you are not using “fastRMF_EoS” and “pQCD”
If you encounter any issues or have questions, feel free to reach out for support. Happy computing!