Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

verify_params_dictionary: vp_100/mstar check is inverted

Đang mở
#43 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
62/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
data

Hướng nghiên cứu

Start in verify_params_dictionary in eddy/rotationmap.py (around L1236), where the vp_100 and mstar branches are inverted, and check where default_parameters.yml fills in mstar=1.0 before that check runs. Done means that setting both keys raises the ValueError, a power-law request with vp_100 set and mstar None selects _vpow without error, and a default mstar no longer blocks the power-law path. Related issue #36 touches the same block.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

The vp_100 / mstar check in verify_params_dictionary has its branches inverted.

# eddy/rotationmap.py, verify_params_dictionary, ~L1236
if params['vp_100'] is not None:
    if params['mstar'] is not None:
        params['vfunc'] = self._vpow
    else:
        raise ValueError("Cannot specify both `vp_100` and `mstar`.")
else:
    params['vfunc'] = self._vkep
  • Both vp_100 and mstar set: the power law is used silently. The error the message describes is never raised.
  • vp_100 set and mstar=None (a pure power-law request): this raises "Cannot specify both vp_100 and mstar", even though only one was specified.
  • vp_100 set, mstar left out: mstar defaults to 1.0 in default_parameters.yml, so this goes through the first branch and works. That is the only reason the power-law path appears to work. It also means the check can never tell an explicit mstar from the default.

Suggested fix

Swap the branches, and record whether mstar was supplied by the user before defaults are filled in, so that a power-law fit isn't rejected because of the default mstar=1.0. For example, check 'mstar' in params before the default-population loop, and raise only if both keys were given explicitly.

Related: #36 (same block; it never selects the pressure-corrected vfunc).

Ngôn ngữ chính
Python
Star
23
Fork
11
Merge trung bình
28 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PlanetFormationLab/eddy

Tất cả issue của PlanetFormationLab/eddy

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.