Skip to content

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

Draft
marcelwa wants to merge 52 commits into
mainfrom
python-interface
Draft

🐍 Add a .pyi file for integration with type checking, documentation, and IDE auto-completion#604
marcelwa wants to merge 52 commits into
mainfrom
python-interface

Conversation

@marcelwa

@marcelwa marcelwa commented Dec 4, 2024

Copy link
Copy Markdown
Collaborator

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 <actions@github.com>
@marcelwa marcelwa added python Pull requests that update Python code tooling Introduced or configured tools labels Dec 4, 2024
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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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

namespace pyfiction
{
#include <sstream>

Copy link
Copy Markdown
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

#define PYFICTION_LOGIC_SIMULATION_HPP

#include "pyfiction/documentation.hpp"
#include "pyfiction/types.hpp"

Copy link
Copy Markdown
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
Copy Markdown
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"
         ^

#include <pybind11/stl.h>

#include <cstdint>

Copy link
Copy Markdown
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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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/stl.h>

#include <cstdint>

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 <fiction/utils/layout_utils.hpp>
#include <fiction/utils/version_info.hpp.in>

#include <pybind11/pybind11.h>

Copy link
Copy Markdown
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>
         ^

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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/stl.h>

#include <cstdint>
#include <stdexcept>

Copy link
Copy Markdown
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
Copy Markdown
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/traits.hpp>
#include <fiction/utils/layout_utils.hpp>

Copy link
Copy Markdown
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>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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 <string>
#include <optional>

Copy link
Copy Markdown
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

#include <pybind11/stl.h>

#include <sstream>

Copy link
Copy Markdown
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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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