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

Update dependencies #708

Merged
merged 1 commit into from
Feb 23, 2025
Merged

Update dependencies #708

merged 1 commit into from
Feb 23, 2025

Conversation

ciscorn
Copy link
Member

@ciscorn ciscorn commented Feb 19, 2025

No description provided.

@ciscorn ciscorn requested a review from nokonoko1203 February 19, 2025 08:23
Copy link

coderabbitai bot commented Feb 19, 2025

Caution

Review failed

The pull request is closed.

"""

Walkthrough

今回の変更は、DummySource構造体とDummySink構造体のrunメソッド内で、乱数生成方法をグローバルなrandom::<f32>()呼び出しから、rand::rng()で初期化されたローカル変数rngを使用する方式に変更しています。具体的には、DummySourceではスリープ時間がrng.random::<f32>() * 10.0で計算され、DummySinkではrng.random::<f32>() * 20.0で計算されます。全体の処理フローやロジックは変わらず、スリープ時間の計算における乱数生成のメカニズムが強化されています。

Changes

ファイル 変更内容
nusamai/tests/pipeline.rs DummySourceDummySinkrun メソッドにローカル変数 rng を導入し、グローバルな random::<f32>() 呼び出しを rng.random::<f32>() に置き換えて、スリープ時間の乱数計算を局所化。

Poem

わたしは跳ねる小さなウサギ
コードの森で新たな風を感じる
rng の魔法で乱数が踊り
眠りの秒がリズムを奏でる
ピョンと飛び、未来へ駆け抜ける! 🐇✨
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 01443f9 and 7ba1998.

⛔ Files ignored due to path filters (5)
  • app/src-tauri/Cargo.toml is excluded by !**/*.toml
  • nusamai-citygml/Cargo.toml is excluded by !**/*.toml
  • nusamai-gpkg/Cargo.toml is excluded by !**/*.toml
  • nusamai-projection/Cargo.toml is excluded by !**/*.toml
  • nusamai/Cargo.toml is excluded by !**/*.toml
📒 Files selected for processing (1)
  • nusamai/tests/pipeline.rs (2 hunks)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1da7050 and 46c9e9a.

⛔ Files ignored due to path filters (4)
  • nusamai-citygml/Cargo.toml is excluded by !**/*.toml
  • nusamai-gpkg/Cargo.toml is excluded by !**/*.toml
  • nusamai-projection/Cargo.toml is excluded by !**/*.toml
  • nusamai/Cargo.toml is excluded by !**/*.toml
📒 Files selected for processing (1)
  • nusamai/tests/pipeline.rs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: test
  • GitHub Check: build
🔇 Additional comments (1)
nusamai/tests/pipeline.rs (1)

43-43: ローカルな乱数生成器の導入について

スレッドセーフティとテストの再現性の観点から、グローバルな乱数生成器の代わりにローカルなインスタンスを使用する方針は適切です。

for _i in 0..100 {
feedback.ensure_not_canceled()?;
std::thread::sleep(std::time::Duration::from_millis(
(5.0 + random::<f32>() * 10.0) as u64,
(5.0 + rng.random::<f32>() * 10.0) as u64,
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

乱数生成の一貫性について

DummySourceでの変更は適切ですが、DummySinkの実装でも同様の変更が必要です。コードベース全体で一貫した乱数生成アプローチを採用することを推奨します。

以下の変更を提案します:

 impl DataSink for DummySink {
     fn run(&mut self, upstream: Receiver, feedback: &Feedback, _schema: &Schema) -> Result<()> {
+        let mut rng = rand::rng();
         for parcel in upstream {
             feedback.ensure_not_canceled()?;

             std::thread::sleep(std::time::Duration::from_millis(
-                (5.0 + random::<f32>() * 20.0) as u64,
+                (5.0 + rng.random::<f32>() * 20.0) as u64,
             ));

Also applies to: 111-113

@ciscorn ciscorn force-pushed the update-deps-20250219 branch 2 times, most recently from 3e028f0 to 01443f9 Compare February 23, 2025 09:19
Copy link

codecov bot commented Feb 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Additional details and impacted files
Components Coverage Δ
GUI 0.00% <ø> (ø)
Backend 74.64% <ø> (ø)
Libraries 85.87% <ø> (ø)

📢 Thoughts on this report? Let us know!

@ciscorn ciscorn force-pushed the update-deps-20250219 branch from 01443f9 to 7ba1998 Compare February 23, 2025 09:46
@ciscorn ciscorn merged commit 7a200a7 into main Feb 23, 2025
5 of 7 checks passed
@ciscorn ciscorn deleted the update-deps-20250219 branch February 23, 2025 09:46
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.

1 participant