Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Bugs found while adding type checking (#66), not yet fixed

オープン
#72 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@ryan-kipawa がすでに取り組んでいます。

2026年10月12日 から。

  • #76 @ryan-kipawa による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
data

調査の方向性

This is a bundle of nine separate bugs, so pick one and work through it alone. Start with eumWrapper.eumGetNextEqvUnit in mikecore/eum.py, whose test is test_eumGetNextEqvUnit_first_unit in tests/test_eum.py. Run the test on the add-pyright branch, where the xfail marker is set. Done means the test passes with the marker removed and the other bugs are left unchanged.

索引モデルが issue の本文から書いたものです。

説明

These bugs were found while adding type checking in #66 and left unfixed there, because fixing them changes behaviour that the types did not expose. Seven are pinned by strict xfail tests on that branch. Each test's reason gives the expected correct behaviour, and the test fails as an XPASS once the bug is fixed, so the marker must then be removed. Line links are to the add-pyright branch.

None of them is covered by an existing issue. #50 lists validation gaps (TODOs where the code raises or skips a check) and #47 the X/Y quantity in geographic projections; both are related but different.

Wrong result, no error

  • eumWrapper.eumGetNextEqvUnit reads the return code the wrong way round (eum.py:1846). The native call returns 1 when it finds a unit and 0 at the end of the list, but the wrapper treats rc != 0 as failure. So eumGetNextEqvUnit(eumUmeter, eumUUnitUndefined) returns (False, eumUUnitUndefined, "") although the native call found meter. This also affects master. Raised by @ecomodeller on #66. Tests: test_eumGetNextEqvUnit_first_unit and test_eumGetNextEqvUnit_after_last_unit (tests/test_eum.py).
  • DfsuBuilder.SetElementIds never stores the ids (DfsuBuilder.py:270). It checks their count and returns, so the file gets the default ids 1, 2, … with no warning. SetNodeIds stores its ids. Test: test_element_ids_are_written (tests/test_dfsu_builder.py).
  • MeshBuilder.SetNodes rounds z to float32 (MeshBuilder.py:57). A mesh built from double z values, such as one read with MeshFile.ReadMesh, is written with z rounded to about 7 digits. Mesh files store z as doubles, and x and y are kept as doubles. Test: test_MeshBuilder_keeps_z_precision (tests/test_mesh.py).
  • Dfs0ToAscii assumes the time axis is in seconds (Dfs0ToAscii.py:56). ReadItemTimeStepNext returns times in the time axis unit, so with a 10-minute step the second row is stamped 00:00:10 instead of 00:10:00. Its own TODO notes the unit is not always seconds. Correct: convert with the time axis's ToSeconds. Test: test_Dfs0ToAscii_writes_calendar_times_in_minutes (tests/test_miketools.py).
  • DfsFile.ReadStaticItem(0) returns the first static item (DfsFile.py:937). It doesn't check the item number or the return code of dfsFindItemStatic, so item 0 returns the first item, with ItemNumber 0. Static item numbers start at 1. Correct: raise ValueError below 1, as __DynamicItemInfoReadAndCreate does for dynamic items. Test: test_read_static_item_zero (tests/test_dfs_basic.py).
  • DfsFile.ReadItemTimeStepNext and ReadItemTimeStep ignore reshape (DfsFile.py:1003). They accept the argument but only Dfs123File reshapes, so reshape=True on a generic DfsFile silently returns flat data. Either reshape or drop the parameter. No test yet.

Fails later, or with no message

  • A reused DfsDynamicItemBuilder returns a blank item (DfsBuilder.py:684). GetDynamicItemInfo replaces ItemInfo with a blank DfsDynamicItemInfo but leaves the builder's "is set" flags True. A second call then passes Validate and returns an item with no name, quantity or value type, which fails only when added to a file. Its comment says it means to store a clone so the builder can be reused. Test: test_dynamic_item_builder_can_be_reused (tests/test_dfsbuilder.py).
  • DfsuBuilder can't create DfsuSpectral0D (DfsuBuilder.py:467). Validate accepts the type, but SetupBuilder has no branch for it and raises a bare Exception with no message. DfsuFile reads a Spectral0D file as data type 2001 with a 6-value MIKE_FM block [nodes, elements, 2, 0, frequencies, directions]. Correct: the builder writes that, or Validate rejects the type with a clear message. Test: test_spectral_0d_file_has_one_spectrum (tests/test_dfsu_builder.py).

Checks that never run

  • DfsBuilder.SetDeleteValue* never check the build stage (DfsBuilder.py:128). Five setters read self.__CheckBuildStage1 without calling it (lines 128, 137, 148, 157, 166), so they can be called at any stage. No test yet.
  • DfsBuilder.Validate checks the encode keys with the wrong index (DfsBuilder.py:283). The loop variable is j but the check reads xKey[i], yKey[i] and zKey[i] (i is the item index), so a compressed file is checked against one key per item instead of all keys. No test yet.

🤖 Generated with Claude Code

主要言語
Python
スター
5
フォーク
1
平均マージ
1日 15時間
マージ済み PR(30日)
16

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DHI/mikecore-python のほかの issue

DHI/mikecore-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。