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

NEW: data/core/downloader.py; data/core/utils.py; errors.py; types_.p… #4

Merged
merged 1 commit into from
Jul 7, 2021

Conversation

vvrubel
Copy link
Owner

@vvrubel vvrubel commented Jul 6, 2021

файлы, необходимые для реализации запросов в базы данных Pubchem

…y; validator.py добавлены для реализации запросов в базы данных Pubchem
@vvrubel vvrubel requested a review from churnikov July 6, 2021 16:40
return isinstance(operation, OperationComplex) and check_tags(tags)


def check_tags(tags) -> bool:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Тип?

.. note:: В текущей версии сервиса доступен поиск только по базе данных ``Compound``.
:param namespace: принимает значения в зависимости от определенного ранее параметра
``domain``. В общем случае может иметь простой и составной характер, поэтому значение должно
быть предварительно обработано функцией ``joined_namespaces``.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Owner Author

Choose a reason for hiding this comment

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

Можно, кстати, так сослаться на функцию, чтобы она стала кликабельной

https://stackoverflow.com/questions/22700606/how-would-i-cross-reference-a-function-generated-by-autodoc-in-sphinx
https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#cross-referencing-python-objects

о, я кстати, хотела насчет этой доки спросить: мне почему-то просто показалось, что лучше ее в конце делать (чутье это ничем не обосновано) - вопрос в том, что имеет ли это смысл или можно вне зависимости о степени завершенности инициализировать?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Я в целом написал, что так можно)
Не надо сейчас это делать

return f"{domain}/{namespace}/{identifiers}"


def operation_specification(operation: str, tags: str = None) -> str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def operation_specification(operation: str, tags: str = None) -> str:
def operation_specification(operation: str, tags: Optional[str] = None) -> str:

return f"{BASE_URL}/{input_spec}/{operation_spec}/{output_format}"


def joined_namespace(prefix: str, suffix: Optional[str] = None) -> str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Просто на будущее, если эти функции не предполагаются для публичного использования, состоит их именовать так:

Suggested change
def joined_namespace(prefix: str, suffix: Optional[str] = None) -> str:
def __joined_namespace(prefix: str, suffix: Optional[str] = None) -> str:

Copy link
Owner Author

Choose a reason for hiding this comment

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

Просто на будущее, если эти функции не предполагаются для публичного использования, состоит их именовать так:

все, которые не импортируются? я кажется припоминаю что-то такое... а там именно два подчеркивания, а не одно?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Я не настаиваю, просто можно так явно обозначить, что предполагается использовать вне этого модуля, а что нет

@vvrubel vvrubel merged commit 8a9888d into master Jul 7, 2021
@vvrubel vvrubel deleted the pubchem-requester branch July 7, 2021 08:14
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.

None yet

2 participants