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

Add and use algorithms for managing iterable #2534

Merged
merged 30 commits into from
Oct 3, 2023
Merged

Add and use algorithms for managing iterable #2534

merged 30 commits into from
Oct 3, 2023

Conversation

alkino
Copy link
Member

@alkino alkino commented Sep 25, 2023

Basic algorithms:

  • void apply_to_first(iterable, value, function) apply function to the first value of iterable. If not found, do nothing.
  • void erase_first(iterable, value) erase the first value of the iterable.

Algorithms designed for range-based for loops:

  • THINGS enumerate(iterable) return a pair of index and value from an iterable forward.
  • THINGS renumerate(iterable) return a pair of index and value from an iterable backward.
  • THINGS reverse(iterable) return the value of iterable in a backward way.
  • THINGS range(iterable) return all the index from a iterable forward.

@azure-pipelines
Copy link

✔️ 7303b74 -> Azure artifacts URL

@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

Merging #2534 (c75d0fc) into master (5868cdd) will increase coverage by 0.03%.
The diff coverage is 86.97%.

@@            Coverage Diff             @@
##           master    #2534      +/-   ##
==========================================
+ Coverage   61.49%   61.53%   +0.03%     
==========================================
  Files         623      625       +2     
  Lines      119197   119263      +66     
==========================================
+ Hits        73296    73384      +88     
+ Misses      45901    45879      -22     
Files Coverage Δ
src/ivoc/ivocrand.cpp 51.52% <100.00%> (-0.15%) ⬇️
src/ivoc/ocpicker.cpp 72.61% <100.00%> (-0.33%) ⬇️
src/ivoc/scenepic.cpp 47.62% <100.00%> (-0.22%) ⬇️
src/nrniv/finithnd.cpp 92.59% <100.00%> (-0.39%) ⬇️
src/nrniv/prcellstate.cpp 96.03% <100.00%> (-0.26%) ⬇️
src/nrniv/savstate.cpp 87.02% <100.00%> (-0.13%) ⬇️
src/utils/enumerate.h 100.00% <100.00%> (ø)
test/unit_tests/utils/enumerate.cpp 100.00% <100.00%> (ø)
src/ivoc/xmenu.cpp 59.89% <83.33%> (-0.04%) ⬇️
src/nrniv/nrndae.cpp 80.87% <88.23%> (ø)
... and 6 more

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bbpbuildbot

This comment has been minimized.

@alkino alkino marked this pull request as ready for review September 25, 2023 14:00
@bbpbuildbot

This comment has been minimized.

@alkino alkino changed the title Add and use algorithm for managing iterable Add and use algorithms for managing iterable Sep 25, 2023
@bbpbuildbot

This comment has been minimized.

@azure-pipelines
Copy link

✔️ 1c212db -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@azure-pipelines
Copy link

✔️ 9ab62bd -> Azure artifacts URL

src/ivoc/scene.cpp Outdated Show resolved Hide resolved
src/ivoc/scenepic.cpp Outdated Show resolved Hide resolved
src/nrncvode/netcvode.cpp Outdated Show resolved Hide resolved
test/unit_tests/utils/enumerate.cpp Outdated Show resolved Hide resolved
test/unit_tests/utils/enumerate.cpp Outdated Show resolved Hide resolved
test/unit_tests/utils/enumerate.cpp Outdated Show resolved Hide resolved
src/nrniv/nrndae.cpp Outdated Show resolved Hide resolved
@azure-pipelines
Copy link

✔️ 57535b9 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 3, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 14 Code Smells

No Coverage information No Coverage information
8.8% 8.8% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@azure-pipelines
Copy link

✔️ c75d0fc -> Azure artifacts URL

@1uc
Copy link
Collaborator

1uc commented Oct 3, 2023

I checked the commits from "Fix sonarsomething" onwards. Looks good.

@pramodk pramodk merged commit d9855f6 into master Oct 3, 2023
34 of 35 checks passed
@pramodk pramodk deleted the new_enumerate branch October 3, 2023 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants