aNANt is a first-of-its-kind 2D materials database hosted by the Theory and Simulations (ThSim) Group from the Materials Research Center at the Indian Institute of Science. Currently, it contains the data for over 23,000 MXenes, with more to come.
Please check it out at: anant.mrc.iisc.ac.in
Project management for aNANt is done almost entirely through GitHub. We will review some useful git concepts in the following subsection, followed by step-by-step instructions on making changes to the code.
-
Cloning: Cloning is the process of copying a GitHub repository into your local machine. For cloning the entire aNANt repo, the command is:
git clone https://github.com/rohith-kms/aNANt-dev
This will clone the main branch. If you want to clone another branch (only), the command is:git clone --single-branch --branch <branch-name> https://github.com/rohith-kms/aNANt-dev
-
Branching: A branch is a parallel verion of the repository. Any changes made in a separate branch will not affect the
main
branch. When developing a new feature, create a new branch and make all changes there. Merge with themain
branch only after all development is completed and bugs are fixed. To check what branch you are working on currently (in your local machine), usegit branch
. To switch to another branch, usegit checkout <branch-name>
. You can create a branch from the GitHub webpage. -
Commiting: Once you have made changes to the project, you have to commit those changes. The command for this is
git commit -m "Your message"
make sure to include relevant and informative commit messages, so that everyone can clearly understand what changes were made to the project. Before commiting, make sure you have added all the new file paths usinggit add .
Usegit status
to check what all you are changing. To push the changes from your local computer to the remote branch, usegit push
-
Pull requests and merging: Once you have developed your branch to a sufficient point, it is time to
merge
it with themain
branch. To do this, you will have to submit what is called a pull request. Go to the GitHub webpage and click on "compare and pull request". As with the commits, you will need to include a message along with your pull request. Make sure these messages are informative and to the point. If you are sure of your changes and you have permission, you can merge with themain
branch. If you're not sure, get someone to review your changes and merge. -
Pulling: Before uploading any changes, it is always a good idea to sync your local repository with the remote. You can do this by using
git pull
-
Create a branch through the GitHub website. If you're not sure how, click here
-
Clone the new branch onto your local computer.
git clone --single-branch --branch <branch-name> https://github.com/rohith-kms/aNANt-dev
-
Make changes to the project.
-
Run
git add .
-
Commit your changes: `git commit -m "Informative commit message"
-
Before pushing the changes to GitHub, pull the latest version of the branch from the remote repository using
git pull
. This will sync your local repository to any changes made by other contributers. -
When you reach a milestone, push your changes into the remote repo.
git push
-
Once you are done with the development of your feature, push your changes and create a pull request through the GitHub webpage. If youre not sure how, click here
-
If you are really sure of your changes, you can go ahead and merge if you have permission. However, this is not recommended. Ideally before merging, we should all look at the pull request and comment on it. Click on the links for detailed instructions on how to do each of these.
-
After your branch has been merged, delete the branch you created. You can do this on the website.
- If you have installed any new python package, mention it in the
requirements.txt
file. This can then be used to install all required packages in one shot, using the commandpip install -r requirements.txt
I have cloned the repository, but 'python manage.py runserver' command is not running (module not found error):
You probably haven't installed all the necessary modules to run aNANt. Install all of them by running pip install -r requirements.txt
. Make sure you're running Python 3 and not Python 2.