mdolab / mdolab/baseclasses

AeroProblem should throw an error when an unsupported kwarg is passed into the initialization

Open
#94 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good first issue
Dominant language
Python
Stars
7
Forks
27
PR merge metrics
No merged PRs in 30d

Description

Description

Andrew from AERO740 found that when xref, not xRef is passed into AeroProblem(), the initialization is just fine even though nothing is happening.
I think baseclasses should return an error.

  1. This could be modifying the AeroProblem python code to check a list of all supported keyword arguments. Return an error if the supplied arg does not exist in the supported keyword arguments.
  2. Another method could be changing the function signature of the __init__() to list out all the kwargs.

I am open to hearing other approaches too.

Steps to reproduce issue

Something like
ap = AeroProblem(args=args, unsupportedArg=randomValue)
or rather
ap = AeroProblem(xref=0.5) does not return an error that you're not setting xRef as intended

Current behavior


Does not throw an error for unsupported keyword arguments in AeroProblem instantiation.

Expected behavior


Throw an error for unsupported keyword argument

Code versions
  • Operating System:
  • Python:
  • OpenMPI:
  • CGNS:
  • PETSc:
  • Compiler:
  • This repository:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the AeroProblem Python class and inspect its init entry point, then run the reported xref and unsupportedArg examples. Compare the accepted initialization arguments with the documented names and add coverage for rejecting unsupported keywords. Done means a misspelled or unknown keyword raises an error while supported initialization still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.