Change bibtex style

This commit is contained in:
Matteo Giantomassi 2018-08-13 23:18:06 +02:00
parent aa9a06f5bd
commit 39a42a6b48
10 changed files with 37 additions and 52 deletions

View File

@ -742,11 +742,12 @@ class AbinitSpaceGroup(OpSequence):
"""
Test whether two k-points in fractional coordinates are symmetry equivalent
i.e. if there's a symmetry operations TO (including time-reversal T, if present)
such that:
such that::
TO(k1) = k2 + G0
Return: namedtuple with:
Return: namedtuple with::
isym: The index of the symmetry operation such that TS(k1) = k2 + G0
Set to -1 if k1 and k2 are not related by symmetry.
op: Symmetry operation.

View File

@ -1265,14 +1265,16 @@ class DdbFile(TextFile, Has_Structure, NotebookWriter):
return DielectricTensorGenerator.from_files(os.path.join(task.workdir, "run.abo_PHBST.nc"),
os.path.join(task.workdir, "anaddb.nc"))
def anaget_elastic(self, relaxed_ion="automatic", piezo="automatic", dde=False, stress_correction=False,
asr=2, chneut=1, mpi_procs=1, workdir=None, manager=None, verbose=0, retpath=False):
def anaget_elastic(self, relaxed_ion="automatic", piezo="automatic",
dde=False, stress_correction=False, asr=2, chneut=1,
mpi_procs=1, workdir=None, manager=None, verbose=0, retpath=False):
"""
Call anaddb to compute elastic and piezoelectric tensors. Require DDB with strain terms.
By default, this method sets the anaddb input variables automatically
by looking at the 2nd-order derivatives available in the DDB file.
This behaviour can be changed by setting explicitly the value of: `relaxed_ion` and `piezo`.
This behaviour can be changed by setting explicitly the value of:
`relaxed_ion` and `piezo`.
Args:
relaxed_ion: Activate computation of relaxed-ion tensors.

View File

@ -780,7 +780,6 @@ class GrunsNcFile(AbinitNcFile, Has_Structure, NotebookWriter):
"""
Splits the values of the finite differences gruneisen along a path like for the phonon bands
"""
try:
return self._split_gruns_fd
except AttributeError:
@ -965,6 +964,7 @@ def calculate_gruns_finite_differences(phfreqs, eig, iv0, volume, dv):
"""
Calculates the Gruneisen parameters from finite differences on the phonon frequencies. Uses the eigenvectors
to match the frequencies at different volumes.
Args:
phfreqs: numpy array with the phonon frequencies at different volumes. Shape (nvols, nqpts, 3*natoms)
eig: numpy array with the phonon eigenvectors at the different volumes. Shape (nvols, nqpts, 3*natoms, 3*natoms)
@ -972,6 +972,7 @@ def calculate_gruns_finite_differences(phfreqs, eig, iv0, volume, dv):
iv0: index of the 0 volume.
volume: volume of the structure at the central volume.
dv: volume variation.
Returns:
A numpy array with the gruneisen parameters. Shape (nqpts, 3*natoms)
"""

View File

@ -632,8 +632,7 @@ class ElectronBands(Has_Structure):
that underestimates the Fermi energy because e.g. the IBZ sampling
is shifted whereas the true VMB is at Gamma.
Return:
New fermi energy in eV.
Return: New fermi energy in eV.
.. warning:
@ -649,11 +648,9 @@ class ElectronBands(Has_Structure):
Args:
edos: |ElectronDos| object.
nelect: Number of electrons.
If None, the number of electrons in self. is used
nelect: Number of electrons. If None, the number of electrons in self. is used
Return:
New fermi energy in eV.
Return: New fermi energy in eV.
"""
if nelect is None:
new_fermie = edos.find_mu(self.nelect)

View File

@ -2,7 +2,7 @@ TODO list:
## High priority
* DONE Remove all the abiview commands that are now implemented in abiopen.
* Get rid of readthedocs
* DONE Add ebands.method to fix the fermi level in semiconductors
Remember that ebands is immutable
@ -16,12 +16,6 @@ TODO list:
* introduce new staus WAITING_FOR_RESTART
so that we don't have to restart task in callbacks
* DONE Check PJDOS in abinit@gitlab
* DONE Add mpirun_args see e.g nic4 and mpirun --bind-to None
* DONE Re-implement max_njobs in the queue using a counter local to the Launcher.
* Fix annoying warnings about k-point sampling.
* Reorganize modules in flowtk to prepare future migration. Modules with gs_works, dfpt_works ...
@ -31,8 +25,7 @@ TODO list:
* Almost DONE: Add support for https://mybinder.readthedocs.io/en/latest/sample_repos.html#conda-environment-with-environment-yml
* ALMOST DONE Add https://github.com/mcmtroffaes/sphinxcontrib-bibtex
Change bibtex style.
* DONE Add https://github.com/mcmtroffaes/sphinxcontrib-bibtex Change bibtex style.
* DONE Add support for DVDV, DDB in plot_networkx (but graphviz is much better)
@ -52,7 +45,7 @@ TODO list:
* remove phononflow
* Add DOS to GSR file (useful if tetra) Create Dosfile ?
* Add DOS to GSR file (useful if tetra) Create Dosfile ? Fortran exec?
* Add with_becs to PhononWork
@ -73,8 +66,6 @@ TODO list:
* DONE Solve problem with visualize in jupyter notebooks (files should be produced in workdir)
* DONE Change shifts default value in g0w0_with_ppmodel_inputs
* Scheduler should report info on exceptions (especially if at the end when on_all_ok is invoked)
* ALMOST DONE: Replace core.tensor with pymatgen tensor
@ -102,13 +93,9 @@ TODO list:
* XG remarks:
- Improve abipy/docs/README.rst mentions
- Improve abipy/docs/README.rst
- Change bibtex style (use same format as abidocs)
open _build/html/index.html
- Band structure and Fermi level
## Low priority
* Use parser subclass to avoid boiler plate code.

View File

@ -419,7 +419,7 @@ def get_parser(with_epilog=False):
help="Use the row index as x-value in the plot. By default the plotter uses the first column as x-values")
# Subparser for abo command.
p_abo = subparsers.add_parser('abo', parents=[copts_parser], help=abiview_abo.__doc__)
#p_abo = subparsers.add_parser('abo', parents=[copts_parser], help=abiview_abo.__doc__)
# Subparser for log command.
p_dirviz = subparsers.add_parser('dirviz', parents=[copts_parser], help=abiview_dirviz.__doc__)

View File

@ -18,7 +18,6 @@ if [[ "${ABIPY_PYTEST}" == "yes" ]]; then
--ignore=abipy/integration_tests --ignore=abipy/data/refs --ignore=abipy/scripts/ \
--ignore=abipy/examples/plot --ignore=abipy/examples/flows --ignore=abipy/gui
else
#pytest --cov-config=.coveragerc --cov=abipy -v --doctest-modules abipy \
pytest -n 2 --cov-config=.coveragerc --cov=abipy -v --doctest-modules abipy \
--ignore=abipy/integration_tests --ignore=abipy/data/refs --ignore=abipy/scripts/ \
--ignore=abipy/examples/plot --ignore=abipy/examples/flows --ignore=abipy/gui
@ -29,7 +28,6 @@ fi
# integration_tests are excluded in setup.cfg
if [[ "${ABIPY_COVERALLS}" == "yes" ]]; then
pytest -n 2 --cov-config=.coveragerc --cov=abipy --cov-append -v abipy/integration_tests
#pytest --cov-config=.coveragerc --cov=abipy --cov-append -v abipy/integration_tests
fi
# Generate documentation

View File

@ -1,7 +1,7 @@
.. _documenting-abipy:
Documenting AbiPy
==================
=================
.. contents::
:backlinks: top
@ -10,16 +10,16 @@ Organization of documentation
-----------------------------
The documentation for AbiPy is generated from ReStructured Text using the Sphinx_ documentation generation tool.
The documentation sources are found in the :file:`~/docs/` directory in the repository. Major items :
The documentation sources are found in the :file:`~/docs/` directory in the repository. Major items:
* index.rst - the top level include document for AbiPy docs
* api - placeholders to automatically generate the api documentation
* scripts - documentation for scripts
* workflows - documentation for workflows
* flow_gallery/gallery - automatically generated by sphinx-gallery
* workflows - Documentation about Abinit flows/works/tasks and TaskManager
* README.rst - the present file
* conf.py - the sphinx configuration
* _static - used by the sphinx build system
* _templates - used by the sphinx build system
The main entry point is :file:`docs/index.rst`, which pulls in
the files for the users guide, developers guide, api reference.
@ -62,7 +62,7 @@ Use::
./ghp_import.py _build/html/ -n -p
to deploy to gh-pages.
to deploy to gh-pages (only for project leader)
.. _formatting-abipy-docs:

View File

@ -17,7 +17,6 @@ import shutil
# documentation root, use os.path.abspath to make it absolute, like shown here.
ABIPY_ROOT = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
#print(ABIPY_ROOT)
sys.path.insert(0, ABIPY_ROOT)
@ -442,22 +441,21 @@ autodoc_member_order = "bysource"
# pybtex provides a very powerful way to create and register new styles, using setuptools entry points,
# as documented here: http://docs.pybtex.org/api/plugins.html
#from pybtex.style.formatting.unsrt import Style as UnsrtStyle
#from pybtex.style.template import toplevel # ... and anything else needed
#from pybtex.plugin import register_plugin
from pybtex.style.formatting.plain import Style
from pybtex.style.labels.alpha import LabelStyle
#class MyStyle(UnsrtStyle):
# def format_label(self, entry):
# print("hello")
# return "APA"
#
# #def format_XXX(self, e):
# # template = toplevel [
# # # etc.
# # ]
# # return template.format_data(e)
#register_plugin('pybtex.style.formatting', 'mystyle', MyStyle)
class AbiPyLabelStyle(LabelStyle):
def format_label(self, entry):
return entry.key
class AbiPyStyle(Style):
default_label_style = 'abipy'
from pybtex.plugin import register_plugin
register_plugin('pybtex.style.labels', 'abipy', AbiPyLabelStyle)
register_plugin('pybtex.style.formatting', 'abipystyle', AbiPyStyle)
# This is for releases http://releases.readthedocs.io/en/latest/usage.html
releases_github_path = "abinit/abipy"

View File

@ -7,4 +7,5 @@ Bibliography
.. rubric:: References
.. bibliography:: refs.bib
:style: abipystyle
:cited: