Skip to content

Update docs about possible MOD files compilation errors with >=9.0#3106

Merged
pramodk merged 4 commits into
masterfrom
pramodk/mod-cpp-docs-9.0
Oct 3, 2024
Merged

Update docs about possible MOD files compilation errors with >=9.0#3106
pramodk merged 4 commits into
masterfrom
pramodk/mod-cpp-docs-9.0

Conversation

@pramodk

@pramodk pramodk commented Oct 1, 2024

Copy link
Copy Markdown
Member
  • Add a table with all models and MOD files so that it would be easy for users to find the changed mod file.

  • Change version to >= 9.0

  • Add a link in the top-level README

  • Check if we should add a link to docs if nrnivmodl fails to compile.

Changes

With this PR, in top level README me / RTD landing page we have

image

And the table in the main docs looks like

image

fixes #1876

Script used to generate table

#!/bin/bash

repos=(
    "https://github.com/ModelDBRepository/2487/pull/1"
    "https://github.com/ModelDBRepository/2730/pull/1"
    "https://github.com/ModelDBRepository/2733/pull/1"
    "https://github.com/ModelDBRepository/3658/pull/1"
    "https://github.com/ModelDBRepository/7399/pull/1"
    "https://github.com/ModelDBRepository/7400/pull/1"
    "https://github.com/ModelDBRepository/8284/pull/1"
    "https://github.com/ModelDBRepository/9889/pull/1"
    "https://github.com/ModelDBRepository/12631/pull/2"
    "https://github.com/ModelDBRepository/26997/pull/1"
    "https://github.com/ModelDBRepository/35358/pull/2"
    "https://github.com/ModelDBRepository/37819/pull/1"
    "https://github.com/ModelDBRepository/51781/pull/1"
    "https://github.com/ModelDBRepository/52034/pull/1"
    "https://github.com/ModelDBRepository/64229/pull/1"
    "https://github.com/ModelDBRepository/64296/pull/1"
    "https://github.com/ModelDBRepository/87585/pull/1"
    "https://github.com/ModelDBRepository/93321/pull/1"
    "https://github.com/ModelDBRepository/97868/pull/2"
    "https://github.com/ModelDBRepository/97874/pull/2"
    "https://github.com/ModelDBRepository/97917/pull/2"
    "https://github.com/ModelDBRepository/105507/pull/2"
    "https://github.com/ModelDBRepository/106891/pull/3"
    "https://github.com/ModelDBRepository/113732/pull/1"
    "https://github.com/ModelDBRepository/116094/pull/1"
    "https://github.com/ModelDBRepository/116830/pull/1"
    "https://github.com/ModelDBRepository/116838/pull/1"
    "https://github.com/ModelDBRepository/116862/pull/1"
    "https://github.com/ModelDBRepository/123815/pull/1"
    "https://github.com/ModelDBRepository/136095/pull/1"
    "https://github.com/ModelDBRepository/136310/pull/1"
    "https://github.com/ModelDBRepository/137845/pull/1"
    "https://github.com/ModelDBRepository/138379/pull/1"
    "https://github.com/ModelDBRepository/139421/pull/1"
    "https://github.com/ModelDBRepository/140881/pull/1"
    "https://github.com/ModelDBRepository/141505/pull/1"
    "https://github.com/ModelDBRepository/144538/pull/1"
    "https://github.com/ModelDBRepository/144549/pull/1"
    "https://github.com/ModelDBRepository/144586/pull/1"
    "https://github.com/ModelDBRepository/146949/pull/1"
    "https://github.com/ModelDBRepository/149000/pull/1"
    "https://github.com/ModelDBRepository/149739/pull/1"
    "https://github.com/ModelDBRepository/150240/pull/1"
    "https://github.com/ModelDBRepository/150245/pull/1"
    "https://github.com/ModelDBRepository/150551/pull/1"
    "https://github.com/ModelDBRepository/150556/pull/1"
    "https://github.com/ModelDBRepository/150691/pull/1"
    "https://github.com/ModelDBRepository/151126/pull/1"
    "https://github.com/ModelDBRepository/151282/pull/1"
    "https://github.com/ModelDBRepository/153280/pull/1"
    "https://github.com/ModelDBRepository/154732/pull/1"
    "https://github.com/ModelDBRepository/155568/pull/1"
    "https://github.com/ModelDBRepository/155601/pull/1"
    "https://github.com/ModelDBRepository/155602/pull/1"
    "https://github.com/ModelDBRepository/156780/pull/1"
    "https://github.com/ModelDBRepository/157157/pull/1"
    "https://github.com/ModelDBRepository/168874/pull/4"
    "https://github.com/ModelDBRepository/181967/pull/1"
    "https://github.com/ModelDBRepository/182129/pull/1"
    "https://github.com/ModelDBRepository/183300/pull/1"
    "https://github.com/ModelDBRepository/185355/pull/2"
    "https://github.com/ModelDBRepository/185858/pull/1"
    "https://github.com/ModelDBRepository/186768/pull/1"
    "https://github.com/ModelDBRepository/187604/pull/2"
    "https://github.com/ModelDBRepository/189154/pull/1"
    "https://github.com/ModelDBRepository/194897/pull/2"
    "https://github.com/ModelDBRepository/195615/pull/1"
    "https://github.com/ModelDBRepository/223031/pull/1"
    "https://github.com/ModelDBRepository/225080/pull/1"
    "https://github.com/ModelDBRepository/231427/pull/2"
    "https://github.com/ModelDBRepository/232097/pull/1"
    "https://github.com/ModelDBRepository/239177/pull/1"
    "https://github.com/ModelDBRepository/241165/pull/1"
    "https://github.com/ModelDBRepository/241240/pull/1"
    "https://github.com/ModelDBRepository/244262/pull/1"
    "https://github.com/ModelDBRepository/244848/pull/2"
    "https://github.com/ModelDBRepository/247968/pull/1"
    "https://github.com/ModelDBRepository/249463/pull/1"
    "https://github.com/ModelDBRepository/256388/pull/1"
    "https://github.com/ModelDBRepository/259366/pull/1"
)


for repo_url in "${repos[@]}"; do
    base_repo_url=$(echo "$repo_url" | sed -E 's/(https:\/\/github\.com\/[^\/]+\/[^\/]+)\/pull\/.*/\1/')
    pull_request_id=$(echo "$repo_url" | sed -E 's/.*\/pull\/([0-9]+)$/\1/')

    json_output=$(gh repo view "$base_repo_url" --json name,url,description,homepageUrl)

    modeldb_id=$(echo "$json_output" | jq -r '.name')
    model_name=$(echo "$json_output" | jq -r '.description')

    if [ ${#model_name} -gt 50 ]; then
        model_name="${model_name:0:20}...${model_name: -30}"
    fi

    diff_output=$(gh pr diff "$pull_request_id" --name-only --repo "$base_repo_url")

    filtered_diff=$(echo "$diff_output" | grep -vE '^(README|.*\.(md|html|txt))$' | tr '\n' ' ')

    # concatenate the output
    echo -e "   * - \`$modeldb_id <https://modeldb.science/$modeldb_id>\`_\n     - $model_name\n     - \`ModelDBRepository/$modeldb_id <$base_repo_url>\`_\n     - \`pull/$pull_request_id <$repo_url/files>\`_ \n     - $filtered_diff"
done

- Add table with all models and MOD files so that it would be
  easy for users to find the changed mod file.
- Change version to >= 9.0
- Add link in  the top level README

fixes #1876
@azure-pipelines

Copy link
Copy Markdown

✔️ 775ec26 -> Azure artifacts URL

@codecov

codecov Bot commented Oct 2, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.89%. Comparing base (5b49b24) to head (2fcabe4).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3106   +/-   ##
=======================================
  Coverage   66.89%   66.89%           
=======================================
  Files         572      572           
  Lines      106664   106664           
=======================================
  Hits        71348    71348           
  Misses      35316    35316           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bbpbuildbot

This comment has been minimized.

@azure-pipelines

Copy link
Copy Markdown

✔️ ac53e5c -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@1uc

1uc commented Oct 2, 2024

Copy link
Copy Markdown
Collaborator

Is this just C->C++ or also about the new data structures? It might be nice to treat them as one topic or at least make sure that the datastructures related documentation is discoverable.

@pramodk

pramodk commented Oct 2, 2024

Copy link
Copy Markdown
Member Author

Is this just C->C++ or also about the new data structures?

@1uc : this is only the user-facing parts and hence only C->C++ part for MOD files.

@pramodk

pramodk commented Oct 2, 2024

Copy link
Copy Markdown
Member Author

@nrnhines: In issue #1876, we mentioned the following:

If compilation fails within nrnivmodl, we should provide an error message that includes a link to the C++ migration documentation.

If this seems beneficial, one potential approach would be to display a message when *.cpp compilation fails in nrnivmodl (or at the end), such as:

Note: If you are encountering compilation issues specifically with NEURON version 9.0 or later, please refer to the C++ migration guide at .

Do you think this would be helpful for users, or could it become more of a distraction than an aid?

@nrnhines

nrnhines commented Oct 2, 2024

Copy link
Copy Markdown
Member

Do you think this would be helpful for users, or could it become more of a distraction than an aid?

Seems to me that that would be helpful.

Comment thread bin/nrnivmodl.in
@sonarqubecloud

sonarqubecloud Bot commented Oct 3, 2024

Copy link
Copy Markdown

Please retry analysis of this Pull-Request directly on SonarCloud

@nrnhines nrnhines left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great job!

Comment thread docs/guide/porting_mechanisms_to_cpp.rst
@pramodk pramodk enabled auto-merge (squash) October 3, 2024 14:32
@azure-pipelines

Copy link
Copy Markdown

✔️ 2fcabe4 -> Azure artifacts URL

@pramodk pramodk merged commit 90f2ec2 into master Oct 3, 2024
@pramodk pramodk deleted the pramodk/mod-cpp-docs-9.0 branch October 3, 2024 15: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.

Improve C++ migration documentation and link to it from nrnivmodl

4 participants