Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyment not respecting type annotations #126

Open
thedannymarsh opened this issue Sep 8, 2022 · 0 comments
Open

Pyment not respecting type annotations #126

thedannymarsh opened this issue Sep 8, 2022 · 0 comments

Comments

@thedannymarsh
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant