Skip to content

Feat/refactoring #2

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Feat/refactoring #2

wants to merge 2 commits into from

Conversation

sschleemilch
Copy link
Collaborator

No description provided.

@slawr
Copy link
Collaborator

slawr commented Jun 9, 2025

Hi @SebastianSchildt @sschleemilch these commits are missing a signed-off
Update: now fixed

- tidy docs
- fix: pyproject toml links and LICENSE
- `jupyter` to dev dependencies
- ci: simplified, added nox
- modules moved under `s2dm`
- pre-commit formatting
- tools -> exporters

Signed-off-by: Sebastian Schleemilch <[email protected]>
@SebastianSchildt
Copy link
Collaborator

@sschleemilch will you "clean up" the mypy stuff?
Do wa have/should we have a pre-commit setup here, like in vss-tools?

@cpodalak
Copy link
Collaborator

We need pre-commit hooks setup for mypy.

@cpodalak
Copy link
Collaborator

cpodalak commented Jun 10, 2025

Overall PR LGTM. changes seem to be refactoring/cleanup. No functional impact.

@jdacoello
Copy link
Collaborator

@sschleemilch will you "clean up" the mypy stuff? Do wa have/should we have a pre-commit setup here, like in vss-tools?

I am cleaning it up right now. All that stuff is there because I didn't check it before. So, I take it on me. :)

@jdacoello
Copy link
Collaborator

Update: Fixed some of the mypy errors. The following are still open:

s2dm % uv run mypy src
src/s2dm/concept/models.py:8: error: Missing type parameters for generic type "ConceptBaseModel"  [type-arg]
src/s2dm/concept/models.py:70: error: "NodeType" has no attribute "id"  [attr-defined]
src/s2dm/concept/models.py:76: error: "NodeType" has no attribute "id"  [attr-defined]
src/s2dm/concept/models.py:100: error: Type argument "ConceptUriNode" of "ConceptBaseModel" must be a subtype of "ConceptBaseModel[Any]"  [type-var]
src/s2dm/concept/models.py:157: error: Type argument "SpecHistoryNode" of "ConceptBaseModel" must be a subtype of "ConceptBaseModel[Any]"  [type-var]
src/s2dm/idgen/models.py:23: error: Returning Any from function declared to return "str"  [no-any-return]
src/s2dm/idgen/models.py:23: error: "GraphQLType" has no attribute "name"  [attr-defined]
src/s2dm/idgen/models.py:36: error: "GraphQLType" has no attribute "values"  [attr-defined]
src/s2dm/idgen/models.py:74: error: Argument 1 of "__eq__" is incompatible with supertype "object"; supertype defines the argument type as "object"  [override]
src/s2dm/idgen/models.py:74: note: This violates the Liskov substitution principle
src/s2dm/idgen/models.py:74: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
src/s2dm/idgen/models.py:74: note: It is recommended for "__eq__" to work with arbitrary objects, for example:
src/s2dm/idgen/models.py:74: note:     def __eq__(self, other: object) -> bool:
src/s2dm/idgen/models.py:74: note:         if not isinstance(other, IDGenerationSpec):
src/s2dm/idgen/models.py:74: note:             return NotImplemented
src/s2dm/idgen/models.py:74: note:         return <logic to compare two IDGenerationSpec instances>
src/s2dm/idgen/models.py:87: error: Function is missing a return type annotation  [no-untyped-def]
src/s2dm/idgen/models.py:88: error: Item "None" of "FieldTypeWrapper | None" has no attribute "internal_type"  [union-attr]
src/s2dm/idgen/models.py:90: error: Function is missing a return type annotation  [no-untyped-def]
src/s2dm/idgen/models.py:91: error: Call to untyped function "is_concept" in typed context  [no-untyped-call]
src/s2dm/idgen/models.py:211: error: "GraphQLType" has no attribute "of_type"  [attr-defined]
src/s2dm/idgen/models.py:220: error: Missing type parameters for generic type "dict"  [type-arg]
src/s2dm/idgen/models.py:239: error: Returning Any from function declared to return "dict[str, int | float | None]"  [no-any-return]
src/s2dm/concept/services.py:18: error: Missing type parameters for generic type "dict"  [type-arg]
src/s2dm/concept/services.py:20: error: Returning Any from function declared to return "dict[Any, Any]"  [no-any-return]
src/s2dm/concept/services.py:239: error: Function is missing a return type annotation  [no-untyped-def]
src/s2dm/concept/services.py:266: error: "GraphQLList[Any]" has no attribute "name"  [attr-defined]
src/s2dm/exporters/spec_history.py:206: error: Argument 2 to "save_spec_history" has incompatible type "Path | None"; expected "Path"  [arg-type]
src/s2dm/exporters/id.py:69: error: Call to untyped function "is_realization" in typed context  [no-untyped-call]
src/s2dm/exporters/id.py:83: error: Function is missing a return type annotation  [no-untyped-def]
src/s2dm/exporters/id.py:108: error: "output" has type "Path" which does not implement __bool__ or __len__ so it could always be true in boolean context  [truthy-bool]
src/s2dm/exporters/concept_uri.py:30: error: Function is missing a return type annotation  [no-untyped-def]
src/s2dm/cli.py:52: error: Function is missing a return type annotation  [no-untyped-def]
src/s2dm/cli.py:52: note: Use "-> None" if function does not return a value
Found 26 errors in 7 files (checked 15 source files)

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

Successfully merging this pull request may close these issues.

5 participants