pyment
pyment copied to clipboard
Pyment not respecting type annotations
Hi, thanks for creating such a cool tool! I am having an issue with my docstrings where the types are not getting recognized. For example, when I run pyment on one of my files, it changes the docstring as shown below in the git diff
:
def potentials_exist(self, sim_dir: str) -> bool:
"""Return bool deciding if potentials have already been written for this sim.
:param sim_dir: directory of this simulation
- :return: boolean!
+ :param sim_dir: str) -> boo:
+ :returns: boolean indicating whether the potentials exist
+
"""
return all(os.path.exists(os.path.join(sim_dir, 'potentials', str(p))) for p, _ in self.master_product_indices)
What I would expect is the following:
def potentials_exist(self, sim_dir: str) -> bool:
"""Return bool deciding if potentials have already been written for this sim.
:param sim_dir: directory of this simulation
+ :rtype sim_dir: str
:return: boolean indicating whether the potentials exist
+ :rtype: bool
"""
return all(os.path.exists(os.path.join(sim_dir, 'potentials', str(p))) for p, _ in self.master_product_indices)
I am using pyment v0.3.4
Is there something I am doing wrong? My command is:
pyment -i reST -o reST -w src/core/simulation.py
I have also tried it without specifying -i and -o and get the same result.
Thanks!