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

🐍 Add a .pyi file for integration with type checking, documentation, and IDE auto-completion #604

Draft
wants to merge 45 commits into
base: main
Choose a base branch
from

Conversation

marcelwa
Copy link
Collaborator

@marcelwa marcelwa commented Dec 4, 2024

Description

This PR adds a .pyi file that defines a type interface for all pyfiction classes and functions. This helps with integration with type checking, documentation, and IDE auto-completion.

Checklist:

  • The pull request only contains commits that are related to it.
  • I have added appropriate tests and documentation.
  • I have added a changelog entry.
  • I have created/adjusted the Python bindings for any new or updated functionality.
  • I have made sure that all CI jobs on GitHub pass.
  • The pull request introduces no new warnings and follows the project's style guidelines.

marcelwa and others added 28 commits December 2, 2024 15:46
…r consistency. Analogously for `volume`.
Signed-off-by: GitHub Actions <[email protected]>
@marcelwa marcelwa added python Pull requests that update Python code tooling Introduced or configured tools labels Dec 4, 2024
@marcelwa marcelwa self-assigned this Dec 4, 2024
@marcelwa marcelwa marked this pull request as draft December 4, 2024 14:39
Copy link

codecov bot commented Dec 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.12%. Comparing base (a30097d) to head (b500068).
Report is 6 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #604   +/-   ##
=======================================
  Coverage   98.11%   98.12%           
=======================================
  Files         232      232           
  Lines       35410    35411    +1     
  Branches     1691     1691           
=======================================
+ Hits        34744    34747    +3     
+ Misses        664      662    -2     
  Partials        2        2           
Files with missing lines Coverage Δ
...ction/algorithms/physical_design/color_routing.hpp 97.82% <ø> (ø)
...clude/fiction/algorithms/physical_design/exact.hpp 89.42% <100.00%> (-0.09%) ⬇️
...n/algorithms/verification/equivalence_checking.hpp 86.27% <ø> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a30097d...b500068. Read the comment docs.

Drewniok and others added 4 commits December 4, 2024 18:15
# Conflicts:
#	bindings/mnt/pyfiction/__init__.py
#	bindings/mnt/pyfiction/test/layouts/test_coordinates.py
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -12,28 +12,29 @@

#include <pybind11/pybind11.h>

namespace pyfiction
{
#include <sstream>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header sstream is not used directly [misc-include-cleaner]

Suggested change

@@ -5,7 +5,6 @@
#ifndef PYFICTION_LOGIC_SIMULATION_HPP
#define PYFICTION_LOGIC_SIMULATION_HPP

#include "pyfiction/documentation.hpp"
#include "pyfiction/types.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'pyfiction/types.hpp' file not found [clang-diagnostic-error]

#include "pyfiction/types.hpp"
         ^

@@ -8,7 +8,8 @@
#include "pyfiction/types.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'pyfiction/types.hpp' file not found [clang-diagnostic-error]

#include "pyfiction/types.hpp"
         ^

@@ -8,7 +8,8 @@
#include "pyfiction/types.hpp"

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include <cstdint>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header cstdint is not used directly [misc-include-cleaner]

Suggested change

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -14,12 +14,18 @@
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include <cstdint>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header cstdint is not used directly [misc-include-cleaner]

Suggested change

#include <cstdint>

#include << stdexcept>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header stdexcept is not used directly [misc-include-cleaner]

Suggested change

@@ -6,7 +6,6 @@
#define PYFICTION_OCCUPATION_PROBABILITY_OF_EXCITED_STATES_HPP

#include "pyfiction/documentation.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'pyfiction/documentation.hpp' file not found [clang-diagnostic-error]

#include "pyfiction/documentation.hpp"
         ^

#include "pyfiction/types.hpp"

#include <fiction/utils/layout_utils.hpp>
#include <fiction/utils/version_info.hpp.in>

#include <pybind11/pybind11.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'pybind11/pybind11.h' file not found [clang-diagnostic-error]

#include <pybind11/pybind11.h>
         ^

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -14,12 +14,17 @@
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include <cstdint>
#include <stdexcept>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header cstdint is not used directly [misc-include-cleaner]

Suggested change
#include <stdexcept>
#include <stdexcept>

@@ -8,12 +8,10 @@
#include "pyfiction/documentation.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'pyfiction/documentation.hpp' file not found [clang-diagnostic-error]

#include "pyfiction/documentation.hpp"
         ^

@@ -8,12 +8,10 @@
#include "pyfiction/documentation.hpp"
#include "pyfiction/types.hpp"

#include <fiction/traits.hpp>
#include <fiction/utils/layout_utils.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header traits.hpp is not used directly [misc-include-cleaner]

Suggested change
#include <fiction/utils/layout_utils.hpp>
#include <fiction/utils/layout_utils.hpp>

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include <string>
#include <optional>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header optional is not used directly [misc-include-cleaner]

Suggested change

@@ -11,7 +11,8 @@
#include <fiction/algorithms/simulation/sidb/time_to_solution.hpp>

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include <sstream>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header sstream is not used directly [misc-include-cleaner]

Suggested change

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -8,7 +8,6 @@
#include "pyfiction/documentation.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'pyfiction/documentation.hpp' file not found [clang-diagnostic-error]

#include "pyfiction/documentation.hpp"
         ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests that update Python code tooling Introduced or configured tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants