Skip to content

Commit

Permalink
fix typo about fparam/aparam (#2925)
Browse files Browse the repository at this point in the history
- fix bug in `Fitting.get_numb_aparam`
- fix bug in `Model.get_numb_param`
- fix bug in `make_fparam_from_compute` (interface to lammps)
  • Loading branch information
ChiahsinChu authored Oct 17, 2023
1 parent 8dcfbf5 commit 05e0d27
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion deepmd/fit/dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def get_numb_fparam(self) -> int:

def get_numb_aparam(self) -> int:
"""Get the number of atomic parameters."""
return self.numb_fparam
return self.numb_aparam

def get_numb_dos(self) -> int:
"""Get the number of gridpoints in energy space."""
Expand Down
2 changes: 1 addition & 1 deletion deepmd/fit/ener.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def get_numb_fparam(self) -> int:

def get_numb_aparam(self) -> int:
"""Get the number of atomic parameters."""
return self.numb_fparam
return self.numb_aparam

def compute_output_stats(self, all_stat: dict, mixed_type: bool = False) -> None:
"""Compute the ouput statistics.
Expand Down
2 changes: 1 addition & 1 deletion deepmd/model/dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def get_numb_fparam(self) -> int:

def get_numb_aparam(self) -> int:
"""Get the number of atomic parameters."""
return self.numb_fparam
return self.numb_aparam

def data_stat(self, data):
all_stat = make_stat_input(data, self.data_stat_nbatch, merge_sys=False)
Expand Down
2 changes: 1 addition & 1 deletion deepmd/model/ener.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def get_numb_fparam(self) -> int:

def get_numb_aparam(self) -> int:
"""Get the number of atomic parameters."""
return self.numb_fparam
return self.numb_aparam

def data_stat(self, data):
all_stat = make_stat_input(data, self.data_stat_nbatch, merge_sys=False)
Expand Down
2 changes: 1 addition & 1 deletion source/lmp/pair_deepmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void PairDeepMD::make_fparam_from_compute(vector<double> &fparam) {
} else if (dim_fparam > 1) {
compute->compute_vector();
double *cvector = compute->vector;
for (int jj = 0; jj < dim_aparam; ++jj) {
for (int jj = 0; jj < dim_fparam; ++jj) {
fparam[jj] = cvector[jj];
}
}
Expand Down

0 comments on commit 05e0d27

Please sign in to comment.