Skip to content

Commit c00e303

Browse files
committed
fix typos ambiguous variable name
1 parent 2ba5368 commit c00e303

File tree

8 files changed

+35
-30
lines changed

8 files changed

+35
-30
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ repos:
2020
rev: 4.0.1
2121
hooks:
2222
- id: flake8
23-
args: [--max-line-length=125]
2423

2524
- repo: https://github.com/pre-commit/pre-commit-hooks
2625
rev: v4.3.0

atomate/vasp/analysis/linear_response.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -253,29 +253,32 @@ def det_deriv(matrix, i, j):
253253
jacobians = [[] for i in range(m)]
254254

255255
det = np.linalg.det(matrix)
256-
for i in range(m):
257-
for j in range(n):
258-
mji = np.delete(np.delete(matrix, j, 0), i, 1)
259-
minor = (-1) ** (i + j) * np.linalg.det(mji)
256+
for idx in range(m):
257+
for jdx in range(n):
258+
mji = np.delete(np.delete(matrix, jdx, 0), idx, 1)
259+
minor = (-1) ** (idx + jdx) * np.linalg.det(mji)
260260

261261
j_matrix = np.zeros([m, n])
262-
for k in range(m):
263-
for l in range(n):
264-
det_p = det_deriv(matrix, k, l)
262+
for kdx in range(m):
263+
for ldx in range(n):
264+
det_p = det_deriv(matrix, kdx, ldx)
265265

266-
if k == j or l == i:
266+
if kdx == jdx or ldx == idx:
267267
minor_p = 0.0
268268
else:
269-
kk, ll = k - 1 if k > j else k, l - 1 if l > i else l
270-
minor_p = (-1) ** (i + j) * det_deriv(mji, kk, ll)
269+
kk, ll = (
270+
kdx - 1 if kdx > jdx else kdx,
271+
ldx - 1 if ldx > idx else ldx,
272+
)
273+
minor_p = (-1) ** (idx + jdx) * det_deriv(mji, kk, ll)
271274

272-
j_matrix[k, l] = (minor_p * det - minor * det_p) / det**2
275+
j_matrix[kdx, ldx] = (minor_p * det - minor * det_p) / det**2
273276

274-
jacobians[i].append(j_matrix)
277+
jacobians[idx].append(j_matrix)
275278

276279
j_vec = np.reshape(j_matrix, [m * n, 1])
277280
sigma_f = np.sum(np.dot(np.transpose(j_vec), np.dot(matrix_covar, j_vec)))
278-
matrixinv_var[i, j] = sigma_f
281+
matrixinv_var[idx, jdx] = sigma_f
279282

280283
return matrixinv, matrixinv_var, jacobians
281284

docs/_sources/running_workflows.rst.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ In the same directory as the POSCAR, create a Python script named ``mgo_bandstru
139139
# create the Workflow
140140
wf = wf_bandstructure(struct)
141141
142-
# finally, instatiate the LaunchPad and add the workflow to it
142+
# finally, instantiate the LaunchPad and add the workflow to it
143143
lpad = LaunchPad.auto_load() # loads this based on the FireWorks configuration
144144
lpad.add_wf(wf)
145145
@@ -188,7 +188,7 @@ Simply add the following Python script (``bs-analysis.py``) to your folder, **ch
188188
# use the get_dos method of the database to get the pymatgen CompleteDOS for that task id
189189
uniform_bs_entry = atomate_db.collection.find_one({'task_label': 'nscf uniform', 'formula_pretty': 'MgO'})
190190
complete_dos = atomate_db.get_dos(uniform_bs_entry['task_id'])
191-
# Instatiate a DosPlotter and plot the DOS.
191+
# instantiate a DosPlotter and plot the DOS.
192192
# Comment out the get_plot and uncomment save_plot if you have no GUI frontend to plot to.
193193
dos_plotter = DosPlotter()
194194
dos_plotter.add_dos_dict(complete_dos.get_element_dos())
@@ -203,7 +203,7 @@ Simply add the following Python script (``bs-analysis.py``) to your folder, **ch
203203
# use the get_band_structure method of the database to get the pymatgen BandStructureSymmLine for that task id
204204
line_bs_entry = atomate_db.collection.find_one({'task_label': 'nscf line', 'formula_pretty': 'MgO'})
205205
bandstructure = atomate_db.get_band_structure(line_bs_entry['task_id'])
206-
# Instatiate a bandstructure plotter and plot the bandstructure.
206+
# instantiate a bandstructure plotter and plot the bandstructure.
207207
# You can uncomment out the get_plot if you have a GUI frontend to plot to.
208208
bs_plotter = BSPlotter(bandstructure)
209209
bs_plotter.get_plot()

docs_rst/changelog.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ atomate Changelog
273273
**v0.4.5**
274274

275275
* *extensive* code review, code cleanup, and improved code docs - with some minor name refactoring
276-
* new builders: dielectric, structureanalysis (currently gives dimensionality of structure)
276+
* new builders: dielectric, structure analysis (currently gives dimensionality of structure)
277277
* rewrite powerups as in-place with cleaner syntax
278278
* improved installation tutorial (B. Bocklund)
279279
* improve/fix/reorganize some unit tests
@@ -296,7 +296,7 @@ atomate Changelog
296296
* Add StdErrorHandler to handlers (A. Jain)
297297
* Auto-detect and remove line_mode parameter in MMVaspDB (A. Jain)
298298
* added unit tests
299-
* misc cleanup, refactoring, and doc udpates
299+
* misc cleanup, refactoring, and doc updates
300300
* misc bugfixes
301301

302302

@@ -351,7 +351,7 @@ atomate Changelog
351351
**v0.2**
352352

353353
* BoltzTraP transport workflows (A. Jain)
354-
* major builder improvements (merge multiple collections, progressbar, config, more...)
354+
* major builder improvements (merge multiple collections, progress bar, config, more...)
355355
* use FrozenJobErrorHandler by default (A. Jain)
356356
* add basic configuration overrides for preset workflows (A. Jain)
357357
* misc improvements and bugfixes (A. Jain, K. Mathew)

docs_rst/creating_workflows.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ In the above code example, we start by importing the classes and functions we'll
223223

224224
Lines 41-51 is where we define the optimization Firework. First we check if a vasp_input_set_relax parameter was passed, if not we default to MPRelaxSet and update that set if the ``user_kpoints_settings`` parameter was passed. It's common to see a similar parameter for ``user_incar_settings``. On line 49 we create our list of Fireworks (``fws``) with the ``OptimizeFW`` that we imported. Take note that this is the only Firework we pass our structure to, which allows for more flexibility. More on this later.
225225

226-
Lines 52-61 we do a similar thing with the ``MPStaticSet`` from pymatgen that we did for the ``MPRelaxSet``. Then in lines 63-71, we loop through each of the deformations passed (as a list of 2-dimensional lists describing deformation matricies) and instantiate ``TransmuterFW`` with that deformation as the ``transformation_params``. For each type of transformation you use (``DeformStructureTransformation``) here, you will need to look at what parameters that class takes and use the right keyword, which is ``deformation`` in this case. Another example is the ``SupercellTransformation`` takes a transformation parameter called ``scale``. Pay close attention that on line 69 we are adding the ``OptimizeFW`` (from ``fws[0]``) as the parent for all of these Fireworks so they can run in parallel.
226+
Lines 52-61 we do a similar thing with the ``MPStaticSet`` from pymatgen that we did for the ``MPRelaxSet``. Then in lines 63-71, we loop through each of the deformations passed (as a list of 2-dimensional lists describing deformation matrices) and instantiate ``TransmuterFW`` with that deformation as the ``transformation_params``. For each type of transformation you use (``DeformStructureTransformation``) here, you will need to look at what parameters that class takes and use the right keyword, which is ``deformation`` in this case. Another example is the ``SupercellTransformation`` takes a transformation parameter called ``scale``. Pay close attention that on line 69 we are adding the ``OptimizeFW`` (from ``fws[0]``) as the parent for all of these Fireworks so they can run in parallel.
227227

228-
Next on lines 73-76 we taking a *Firetask* and wrapping it in a pure Firework object from FireWorks. This demonstrates the modularity and customizability that FireWorks allows, which favors composing existing objects over writing custom ones for each level of abstraction. We are passing the same sort of parameters to this Firetask that we have been passing, which allows you to correctly infer that Fireworks themselves propogate relevant parameters down to their Firetasks. Again, we are setting the parents of this analysis Firework to all of the Fireworks in our list except the first one (the ``OptimizeFW``). This ensure that the analysis does not run until *all* of our transformed structures have finished running.
228+
Next on lines 73-76 we taking a *Firetask* and wrapping it in a pure Firework object from FireWorks. This demonstrates the modularity and customizability that FireWorks allows, which favors composing existing objects over writing custom ones for each level of abstraction. We are passing the same sort of parameters to this Firetask that we have been passing, which allows you to correctly infer that Fireworks themselves propagate relevant parameters down to their Firetasks. Again, we are setting the parents of this analysis Firework to all of the Fireworks in our list except the first one (the ``OptimizeFW``). This ensure that the analysis does not run until *all* of our transformed structures have finished running.
229229

230230
Finally we use a vanilla FireWorks ``Workflow`` object to pull in all our Fireworks, update the name of the Workflow and return the object. From here you can write a script similar to the :ref:`running workflows tutorial` and pass in the correct variables to get a workflow to add to the LaunchPad. In this workflow, pay attention to the ``vasp_cmd`` parameter and ``db_file`` parameters to get the correct behavior. The preset workers will default these to your FireWorker's environment variables, but you will have to handle that manually here. To use your environment variables, pass in ``'>>vasp_cmd<<'`` and ``'>>db_file<<'`` for each of these parameters, respectively. More on this behavior in the `env_chk`_ section.
231231

@@ -254,7 +254,7 @@ Powerups (:py:mod:`atomate.vasp.powerups`) enable modifications to be made to wo
254254

255255
Some useful powerups that affect the behavior of VASP are
256256

257-
* ``add_modify_incar``: Update the INCAR of Fireworks specifed by (partially matched) name at runtime
257+
* ``add_modify_incar``: Update the INCAR of Fireworks specified by (partially matched) name at runtime
258258
* ``set_fworker``: specify certain FireWorkers for workflows. Useful for FireWorkers tuned for high-memory or high-precision jobs
259259
* ``modify_to_soc``: makes all of the VASP calculations that match the constraints take spin orbit coupling into account
260260
* ``remove_custodian``, ``use_custodian``, ``run_fake_vasp``: Choose to run VASP with or without custodian (or not at all, useful for debugging)
@@ -279,7 +279,7 @@ Workflows in atomate are powerful for getting science done quickly because they
279279
* Ensure more consistent and easier usage of INCAR parameters you use often, such as setting a high ``NEDOS`` INCAR parameter
280280
* Set FireWorkers up for low and high precision jobs, or normal and high-memory jobs on the same computing resource.
281281

282-
To use ``env_chk``, you don't have to do anything explicity, just pass ``'>>db_file<<'``, ``'>>vasp_cmd<<'``, ``'>>incar_update<<'`` to any parameter that supports ``env_chk``.
282+
To use ``env_chk``, you don't have to do anything explicitly, just pass ``'>>db_file<<'``, ``'>>vasp_cmd<<'``, ``'>>incar_update<<'`` to any parameter that supports ``env_chk``.
283283

284284
Currently supported ``env_chk`` variables are:
285285

docs_rst/installation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This guide will get you up and running in an environment for running high-throug
1616

1717
Details about how atomate is designed can be found in the `atomate paper`_ and an overview of how these different pieces interact are in a `Slideshare presentation`_. Running and writing your own workflows are covered in later tutorials. For now, these topics will be covered in enough depth to get you set up and to help you know where to troubleshoot if you are having problems.
1818

19-
It is assumed that you are comfortable with basic Linux shell commands and navigation. If not, `Linux Journey`_ and `Linux Command`_ breifly cover enough to get you started. It will also be helpful if you are familiar with Python, but it is not strictly required for installation.
19+
It is assumed that you are comfortable with basic Linux shell commands and navigation. If not, `Linux Journey`_ and `Linux Command`_ briefly cover enough to get you started. It will also be helpful if you are familiar with Python, but it is not strictly required for installation.
2020

2121
Note that this installation tutorial is VASP-centric since almost all functionality currently in atomate pertains to VASP.
2222

@@ -618,9 +618,9 @@ Q: I made a mistake using reservation mode, how do I cancel my job?
618618
619619
lpad rerun_fws -i 1
620620
621-
where `-i 1` means to make perfom the operations on the FireWork at index 1. Run ``lpad -h`` to see all of the options.
621+
where `-i 1` means to make perform the operations on the FireWork at index 1. Run ``lpad -h`` to see all of the options.
622622
623-
The non-reservation mode for qlaunching requires a little less maintenance with certain tradeoffs, which are detailed in the FireWorks documentation.
623+
The non-reservation mode for ``qlaunch`` requires a little less maintenance with certain tradeoffs, which are detailed in the FireWorks documentation.
624624
625625
Q: I honestly tried everything I can to solve my problem. I still need help!
626626
----------------------------------------------------------------------------

docs_rst/running_workflows.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ In the same directory as the POSCAR, create a Python script named ``mgo_bandstru
139139
# create the Workflow
140140
wf = wf_bandstructure(struct)
141141
142-
# finally, instatiate the LaunchPad and add the workflow to it
142+
# finally, instantiate the LaunchPad and add the workflow to it
143143
lpad = LaunchPad.auto_load() # loads this based on the FireWorks configuration
144144
lpad.add_wf(wf)
145145
@@ -188,7 +188,7 @@ Simply add the following Python script (``bs-analysis.py``) to your folder, **ch
188188
# use the get_dos method of the database to get the pymatgen CompleteDOS for that task id
189189
uniform_bs_entry = atomate_db.collection.find_one({'task_label': 'nscf uniform', 'formula_pretty': 'MgO'})
190190
complete_dos = atomate_db.get_dos(uniform_bs_entry['task_id'])
191-
# Instatiate a DosPlotter and plot the DOS.
191+
# instantiate a DosPlotter and plot the DOS.
192192
# Comment out the get_plot and uncomment save_plot if you have no GUI frontend to plot to.
193193
dos_plotter = DosPlotter()
194194
dos_plotter.add_dos_dict(complete_dos.get_element_dos())
@@ -203,7 +203,7 @@ Simply add the following Python script (``bs-analysis.py``) to your folder, **ch
203203
# use the get_band_structure method of the database to get the pymatgen BandStructureSymmLine for that task id
204204
line_bs_entry = atomate_db.collection.find_one({'task_label': 'nscf line', 'formula_pretty': 'MgO'})
205205
bandstructure = atomate_db.get_band_structure(line_bs_entry['task_id'])
206-
# Instatiate a bandstructure plotter and plot the bandstructure.
206+
# instantiate a bandstructure plotter and plot the bandstructure.
207207
# You can uncomment out the get_plot if you have a GUI frontend to plot to.
208208
bs_plotter = BSPlotter(bandstructure)
209209
bs_plotter.get_plot()

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ profile = black
2424

2525
[tool:pytest]
2626
addopts = --ignore=atomate/qchem/test_files
27+
28+
[codespell]
29+
ignore-words-list = mater,nin

0 commit comments

Comments
 (0)