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

Addition of subyt to sema #67

Merged
merged 6 commits into from
Jul 15, 2024
Merged

Addition of subyt to sema #67

merged 6 commits into from
Jul 15, 2024

Conversation

cedricdcc
Copy link
Member

handles the following issues:

@@ -84,7 +84,7 @@ test-coverage-with-graphdb: ## runs the standard test-suite for all available i
check: ## performs linting on the python code
@poetry run black --check --diff .
@poetry run isort --check --diff .
@poetry run flake8 . --exclude ${FLAKE8_EXCLUDE}
@poetry run flake8 . --exclude ${FLAKE8_EXCLUDE} --ignore=E203,W503
Copy link
Member Author

Choose a reason for hiding this comment

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

W503 line break before binary operator -> doesn't play well with max line length
E203 local black formattor kept undoing changes with format on save -> psf/black#315

Copy link

github-actions bot commented Jul 10, 2024

Tests coverage table for 05cb08b commit.

pycoverage

Name Stmts Miss Cover Missing
sema/commons/clean/clean.py 104 0 100.0%
sema/commons/j2/j2_functions.py 102 1 99.02% 172
sema/commons/j2/rdf_syntax_builder.py 6 0 100.0%
sema/commons/j2/syntax_builder.py 33 3 90.91% 31 39 41
sema/commons/log/loader.py 16 1 93.75% 28
sema/commons/store/build.py 9 1 88.89% 24
sema/commons/store/store.py 181 55 69.61% 150-151 330-333 335-336 338 341-342 349-350 354 357-359 363-365 368-369 372-373 376-377 380-381 398 401 403 410 414-415 417 422-423 426 428 431 436 441 444 447-448 451 455 518 521 524 529 532 535 538 542
sema/discovery/lod_html_parser.py 22 0 100.0%
sema/discovery/url_to_graph.py 71 16 77.46% 41 80 85-86 114 125-126 133 135-140 146 152
sema/subyt/api.py 138 3 97.83% 156 347 351
sema/subyt/j2/generator.py 14 0 100.0%
sema/subyt/sinks.py 90 12 86.67% 19 33-34 38 42 55 58 61 64 67 77 80
sema/subyt/sources.py 215 21 90.23% 26 70-77 92-93 125 243-244 275 286 289-290 321 328
sema/subyt/subyt.py 21 0 100.0%
TOTAL 1022 113 88.94%

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated
@@ -16,6 +16,10 @@ python-dateutil = "^2.9.0.post0"
setuptools = "*"
uritemplate = "^4.1.1"
urllib3 = "^2.2.2"
requests = "^2.32.3"
typeguard = "^4.3.0"
xmlasdict = "^0.2.2"
Copy link
Member

Choose a reason for hiding this comment

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

xmlasdict dependency is also not required for subyt use - only when you want to deal with xml inputs (which we do, but only inside the tests?)

caveat -- documentation will need to make clear that such usage declares its own dependency on xmlasdict

makes me think (new issue?) we could also register a fake source class that makes that statement explicitely when people try inputtinh files that do require the XMLSource

Copy link
Member

Choose a reason for hiding this comment

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

note: currently there is a log.warn already about the xml support being not available when the xmlasdict dependency is not met -- as suggested above, we might extend that policy with a more upfront message / fail when XML processing is actually attempted later

Copy link
Member Author

Choose a reason for hiding this comment

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

Further handling done by #68

log.info(f"Logging enabled according to config in {args.logconf}")


def main():
Copy link
Member

Choose a reason for hiding this comment

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

can main() be made to use Sybut ?
if not now -- in a todo-issue for later?

Copy link
Member Author

Choose a reason for hiding this comment

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

taken up in #69

"""Source context cleanup"""


# TODO make a pandas source in sources.py
Copy link
Member

@marc-portier marc-portier Jul 10, 2024

Choose a reason for hiding this comment

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

remove this comment, rather introduce an issue at gh for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

taken up in #70

sema/subyt/api.py Outdated Show resolved Hide resolved
sema/subyt/api.py Outdated Show resolved Hide resolved
sema/subyt/api.py Outdated Show resolved Hide resolved
sema/subyt/api.py Outdated Show resolved Hide resolved
sema/subyt/api.py Outdated Show resolved Hide resolved
args = get_arg_parser().parse_args()

enable_logging(args)
service = make_service(args)
Copy link
Member

Choose a reason for hiding this comment

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

precursor of the new style "service" interface introduced by sembench
-- maybe we should consider supporting that way of calling the core process with string-arguments only already?

Copy link
Member Author

Choose a reason for hiding this comment

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

taken up in issue #71

sema/subyt/api.py Outdated Show resolved Hide resolved
sema/subyt/api.py Outdated Show resolved Hide resolved
:param templates_folder: Location of the templates defaults to "."
"""
self._templates_folder = templates_folder
ttl_filter = {"ttl": Filters.all()["xsd"]}
Copy link
Member

Choose a reason for hiding this comment

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

do we still want this?
move to sema looks like a good time to get rid off the older ttl syntax?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have no idea what this does so I'm leaving it here for now

Copy link
Member

Choose a reason for hiding this comment

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

this keeps | ttl working as it looks up the xsd filter and registers it again as ttl too

Copy link
Member

Choose a reason for hiding this comment

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

fixed in 05cb08b

sema/subyt/sinks.py Outdated Show resolved Hide resolved
sema/subyt/sinks.py Outdated Show resolved Hide resolved
sema/subyt/sinks.py Outdated Show resolved Hide resolved
sema/subyt/sinks.py Outdated Show resolved Hide resolved
sema/subyt/sinks.py Outdated Show resolved Hide resolved
sema/subyt/sources.py Outdated Show resolved Hide resolved
sema/subyt/sinks.py Outdated Show resolved Hide resolved
sema/subyt/api.py Outdated Show resolved Hide resolved
sema/subyt/subyt.py Outdated Show resolved Hide resolved
Copy link
Member

@marc-portier marc-portier left a comment

Choose a reason for hiding this comment

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

  • missing some opportunities to do cleanup of some historic stuff
  • also introduces new stuff that should be reconsidered imho (mainly a smart selection of when to load_log_config)
  • introducing unwanted dependencies too
  • unsure about the increased leniency on the discovery test

surely would like to see some fix on the dependency management, other things could move to follow up issues if need be

@cedricdcc cedricdcc requested a review from marc-portier July 10, 2024 19:13
@marc-portier marc-portier merged commit 4ffeb67 into main Jul 15, 2024
1 check passed
@marc-portier marc-portier deleted the feature/subyt branch July 15, 2024 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants