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

Feat: related article validation #698

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
71628cf
Adapta a classe de validação ao novo modelo
Rossi-Luciano Sep 12, 2024
8cd2d4e
Adapta os testes
Rossi-Luciano Sep 12, 2024
4f19b32
Adiciona validação para os atributos de 'related-article'
Rossi-Luciano Sep 13, 2024
e1c0ad1
Adiciona validação para evento em 'history'
Rossi-Luciano Sep 13, 2024
641094a
Adiciona testes
Rossi-Luciano Sep 13, 2024
7beefdc
Remove 'related_articles_matches_history_date_validation'
Rossi-Luciano Sep 14, 2024
8e9232f
Adapta os testes
Rossi-Luciano Sep 14, 2024
fdc7fb0
Refatora e complementa validação de 'errata'
Rossi-Luciano Sep 22, 2024
e35d721
Adapta e adiciona testes
Rossi-Luciano Sep 22, 2024
5cb9511
Remove 'validation' de 'title'
Rossi-Luciano Sep 22, 2024
96a3999
Adapta os testes
Rossi-Luciano Sep 22, 2024
d3facd9
Refatora validação de 'errata'
Rossi-Luciano Sep 24, 2024
530ad59
Adapta os testes
Rossi-Luciano Sep 24, 2024
80664ef
Adiciona argumento "related_article_type"
Rossi-Luciano Sep 30, 2024
078c2b8
Adiciona teste
Rossi-Luciano Sep 30, 2024
3c9f8ef
Remove o módulo de validação de 'preprint'
Rossi-Luciano Oct 9, 2024
a1fc865
Remove o módulo de validação de 'errata'
Rossi-Luciano Oct 9, 2024
35158fc
Corrige a extensão dos arquivos de listas controladas
Rossi-Luciano Oct 9, 2024
2af892d
Adiciona 'related_article.json'
Rossi-Luciano Oct 9, 2024
14f341f
Adiciona 'related_article_type_date_type.json'
Rossi-Luciano Oct 9, 2024
619c161
Renomeia classe
Rossi-Luciano Oct 9, 2024
acfb059
Adiciona 'remove_namespaces()'
Rossi-Luciano Oct 9, 2024
6f6b968
Aplica formatação
Rossi-Luciano Oct 9, 2024
cfac0fa
Adiciona 'full_tag'
Rossi-Luciano Oct 9, 2024
626fdd3
Aplica formatação
Rossi-Luciano Oct 9, 2024
df03ab3
Corrige importações
Rossi-Luciano Oct 9, 2024
f919184
Corrige e adiciona 'docstring'
Rossi-Luciano Oct 9, 2024
c1a45b2
Remove validação de atributos (substituída pela validação de ordem)
Rossi-Luciano Oct 9, 2024
2d946ec
Adiciona 'validate_history_date'
Rossi-Luciano Oct 9, 2024
fdc7e89
Adiciona validação de ordem dos atributos
Rossi-Luciano Oct 9, 2024
3d347e6
Adiciona validação de DOI
Rossi-Luciano Oct 9, 2024
4d373d3
Adiciona 'validate'
Rossi-Luciano Oct 9, 2024
47c4598
Adiciona 'validate_related_article_matches_article_type'
Rossi-Luciano Oct 9, 2024
cbb03fe
Adapta testes de artigos relacionados
Rossi-Luciano Oct 9, 2024
e324186
Adapta testes de 'errata'
Rossi-Luciano Oct 9, 2024
5946418
Adapta testes de 'preprint'
Rossi-Luciano Oct 9, 2024
aeea305
Merge branch 'master' into feat_realated_article_validation
Rossi-Luciano Oct 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packtools/sps/models/v2/related_articles.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@
</related-article>
"""

from packtools.sps.utils.xml_utils import put_parent_context, process_subtags
from packtools.sps.utils.xml_utils import put_parent_context, process_subtags, tostring


def remove_namespaces(xml_string):
Copy link
Member

Choose a reason for hiding this comment

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

@Rossi-Luciano qual a necessidade?

namespaces_to_remove = [
'xmlns:xlink="http://www.w3.org/1999/xlink"',
'xmlns:mml="http://www.w3.org/1998/Math/MathML"',
]
for ns in namespaces_to_remove:
xml_string = xml_string.replace(ns + " ", "")
return xml_string


class RelatedArticle:
Expand Down