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

Make sure docgen uses induced slots #408

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions src/doc-templates/index.md.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ See [here](https://github.com/mapping-commons/sssom/tree/master/examples/schema)
| Column/Field | Description | Required |
|--------------------|---------------------------------------------------------|-------------|
{%- for slot in c.slots %}
{%- set slot_info = schemaview.get_slot(slot) %}
{%- set slot_info = schemaview.induced_slot(slot, c.name) %}
Comment on lines 52 to +53
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the logic in these lines and some lines above can be reduced using the class_induced_slots() method in SchemaView?

Like if you know the name of the class (mapping/mapping set) for which you want to retrieve a list of induced slots, then you can simply make calls to class_induced_slots() and pass mapping/mapping set as arguments.

| **{{ gen.link(slot) }}** | {{ slot_info.description | default("No description") }} | {% if slot_info.required | default(false) %}Required{% elif slot_info.recommended | default(false) %}Recommended{% else %}Optional{% endif %} |
{%- endfor %}
{%- endif %}
Expand All @@ -65,7 +65,7 @@ See [here](https://github.com/mapping-commons/sssom/tree/master/examples/schema)
| Column/Field | Description | Required |
|--------------------|---------------------------------------------------------|-------------|
{%- for slot in c.slots %}
{%- set slot_info = schemaview.get_slot(slot) %}
{%- set slot_info = schemaview.induced_slot(slot, c.name) %}
Comment on lines 67 to +68
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above for these lines as well.

| **{{ gen.link(slot) }}** | {{ slot_info.description | default("No description") }} | {% if slot_info.required | default(false) %}Required{% elif slot_info.recommended | default(false) %}Recommended{% else %}Optional{% endif %} |
{%- endfor %}
{%- endif %}
Expand Down
Loading