-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: main
Are you sure you want to change the base?
Conversation
fe85597
to
580648f
Compare
Hi |
0b13431
to
5ea2891
Compare
- 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]>
5ea2891
to
638a97f
Compare
@sschleemilch will you "clean up" the mypy stuff? |
We need pre-commit hooks setup for mypy. |
Overall PR LGTM. changes seem to be refactoring/cleanup. No functional impact. |
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. :) |
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) |
Signed-off-by: Daniel Alvarez-Coello <[email protected]>
ce4ea47
to
6f59b28
Compare
No description provided.