HamishGBrown / py_multislice

A GPU accelerated Python multislice slice code
24 stars 16 forks source link

nslices in STEM? #3

Closed thomasaarholt closed 4 years ago

thomasaarholt commented 4 years ago

In the following code snippet of the STEM code, len(nslices) is called. But the naming of "nslices", and its description "nslices -- The number of slices to perform multislice over", implies that nslices is an int and therefore has no len:

>>> len(5)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: object of type 'int' has no len()

So is the naming wrong, or should "nthick" actually be "nslices"? https://github.com/HamishGBrown/py_multislice/blob/c0e961ac49a7973df492544ae6c2a84a3befb435/pyms/py_multislice.py#L347

HamishGBrown commented 4 years ago

nslices can be a int (number of slices to perform multislice over) or an array_like object (which specifies exactly which slices of the structure to include and in which order). Relevant docstrings etc have been updated.