Skip to content

Conversation

@samuelveigarangel
Copy link
Collaborator

@samuelveigarangel samuelveigarangel commented Aug 5, 2024

O que esse PR faz?

Refatora processamento XML PMC para melhorar o tratamento de elementos e ampliar a cobertura de testes

Onde a revisão poderia começar?

pelos commits

Como este poderia ser testado manualmente?

python3 setup.py test -s tests/sps/formats/test_pmc.py

Algum cenário de contexto que queira dar?

N/A

Screenshots

N/A

Quais são tickets relevantes?

N/A

Referências

https://scielo.readthedocs.io/projects/scielo-publishing-schema/pt-br/latest/tagset/elemento-aff.html

@samuelveigarangel samuelveigarangel changed the title refactor xml_pmc_aff for aff elements [wip] refactor xml_pmc_aff for aff elements Aug 5, 2024
@samuelveigarangel samuelveigarangel changed the title [wip] refactor xml_pmc_aff for aff elements Refatoração do processamento XML PMC para melhorar o tratamento de elementos <aff> e ampliar a cobertura de testes Aug 9, 2024
Comment on lines 55 to 56
named_contents = addr_line.findall(".//named-content")
aff_with_address.extend([named_content.text for named_content in named_contents])
Copy link
Member

Choose a reason for hiding this comment

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

@samuelveigarangel algumas versões tem city e state no lugar de named-content. Então, você tem que considerá-los para completar aff.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok.


addr_line = aff.find("./addr-line")
if addr_line is not None:
named_contents = addr_line.findall(".//named-content")
Copy link
Member

Choose a reason for hiding this comment

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

No lugar de named_contents = addr_line.findall(".//named-content"), use named_contents = addr_line.xpath(".//named-content | .//state | .//city")

named_contents = addr_line.findall(".//named-content")
aff_with_address.extend([named_content.text for named_content in named_contents])

country = aff.find("./country")
Copy link
Member

Choose a reason for hiding this comment

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

@samuelveigarangel pode adicionar o country no xpath

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.

2 participants