Skip to content

SimpleTask feature#218

Open
nakul680 wants to merge 37 commits into
faccts:feature/simple-tasksfrom
nakul680:simple_keyword_lookup
Open

SimpleTask feature#218
nakul680 wants to merge 37 commits into
faccts:feature/simple-tasksfrom
nakul680:simple_keyword_lookup

Conversation

@nakul680

Copy link
Copy Markdown
Collaborator

Closes Issues

Closes #
...

Description

  • Implements TaskParams and Task classes
  • Implement way to lookup simple keywords from strings

Release Notes

(Project adheres to Keep a Changelog; Every entry should start in upper-case and end with (#<pr-id>); Remove sections that don't apply)

Added

Changed

  • ...

@nakul680 nakul680 self-assigned this Mar 16, 2026
@nakul680 nakul680 requested a review from a team as a code owner March 16, 2026 16:31
@timmyte

timmyte commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

@nakul680
Did you also take into account, that we substitute some letters/characters in the original names and that both key and value could be used to lookup the respective enum member, e.g.

G6_311GSTARSTAR = SimpleKeyword("6-311g**")

Searching for G6_311GSTARSTAR or 6-311g** should both yield the same enum member.

@nakul680 nakul680 force-pushed the simple_keyword_lookup branch from 29019e7 to 790a499 Compare March 25, 2026 08:46
@nakul680 nakul680 force-pushed the simple_keyword_lookup branch from 10f331e to 9fa47b5 Compare March 25, 2026 15:58
@nakul680

nakul680 commented Apr 1, 2026

Copy link
Copy Markdown
Collaborator Author
  • Changed TaskParams to Settings, which have child classes 'TaskSettingsandMethodSettings`.
  • Task class renamed to SimpleTask, added method_settings and task_settings parameters.
  • validate() function in Settings class has been repurposed to contain cross-validation logic (which is not implemented yet) , as validate_field() function already handles all validation
  • Added documentation
  • created new file method_settings.py I think all child classes of MethodSettings i.e the 4 major groupings like DftSettings, WftSettings etc. should live here since they are not task-dependant.

@nakul680

nakul680 commented Apr 13, 2026

Copy link
Copy Markdown
Collaborator Author

Latest changes:

  • Introduction of new groupings like ScfConvergence , ScfThreshold etc. These are now the base classes holding keyword of this type, and the larger grouping Scf will inherit from these classes.
  • Fleshed out DftSettings class , added cross validation in case of specific methods, and added logic to look for dispersion correction keywords.
  • added strict flag to avoid overwriting existing working directories.
  • solvent, solvation_model are now optional keywords.
  • added aliasing for simple keywords to allow for a better API

@nakul680 nakul680 changed the title WIP: Task class SimpleTask feature May 27, 2026

@haneug haneug left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I added some initial comments but I have only scratched the surface so far. I will regularly update my findings here.

Comment thread examples/exmp054_singlepoint_simpletask/job.py
Comment thread src/opi/simple_tasks/tasks/single_point_task.py
Comment thread src/opi/simple_tasks/simple_task.py
Comment thread src/opi/simple_tasks/tasks/engrad_task.py
Comment thread examples/exmp056_opt_simpletask/job.py
Comment thread src/opi/input/simple_keywords/base.py Outdated
Comment thread src/opi/input/simple_keywords/base.py
Comment thread src/opi/input/simple_keywords/base.py Outdated
Comment thread src/opi/input/simple_keywords/base.py

@haneug haneug left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

My question from this round would be: Is it possible to add something to the input object of the Task? Lets say I want to add a specific simple keyword can I do that?

Comment thread src/opi/simpletasks/base_task.py Outdated
Comment thread src/opi/simpletasks/engrad_task.py Outdated
Comment thread src/opi/simpletasks/engrad_task.py Outdated
Comment thread src/opi/simple_tasks/simple_task.py Outdated
Comment thread src/opi/simpletasks/method_settings.py Outdated
Comment thread src/opi/simpletasks/method_settings.py Outdated
Comment thread src/opi/simpletasks/base_task.py Outdated
@nakul680

nakul680 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

My question from this round would be: Is it possible to add something to the input object of the Task? Lets say I want to add a specific simple keyword can I do that?

yes i fixed the issue with the input object being newly initialized every time, so now it should be possible

@nakul680 nakul680 requested a review from haneug June 1, 2026 14:32
@haneug

haneug commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

My question from this round would be: Is it possible to add something to the input object of the Task? Lets say I want to add a specific simple keyword can I do that?

yes i fixed the issue with the input object being newly initialized every time, so now it should be possible

I tried to use it but the input was just empty for me. Also I think using chached_property here is not really good style. Can we just have the input as a plain attribute and initialize it in the initialization of task? Or is there a specific reason why you need to have it as a property?

@haneug haneug left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice additions, the input does not work for me yet. Could you add an example? Just request the Hirshfeld charges in the singlepoint via AtomicCharge.HIRSHFELD.
I also had some things that I believe need some more explanations in the simplekeyword setup.

Comment thread src/opi/simple_tasks/tasks/engrad_task.py
Comment thread examples/exmp056_opt_simpletask/job.py
Comment thread src/opi/input/blocks/base.py
Comment thread src/opi/input/blocks/base.py
Comment thread src/opi/input/simple_keywords/base.py Outdated
Comment thread src/opi/input/simple_keywords/base.py Outdated
Comment thread src/opi/input/simple_keywords/base.py Outdated
Comment thread src/opi/input/simple_keywords/base.py Outdated
Comment thread src/opi/input/simple_keywords/base.py
Comment thread src/opi/simple_tasks/freq/freq_task.py Outdated
nakul680 added 7 commits June 3, 2026 09:46
__or__( ) makes more sense and communicates intent of operator better since it is meant to merge rather than concatenate.
There are not required anymore since the inheritance scheme of the SimpleKeywordBox classes has been changed
…bject.

Add example to showcase how the user can modify the input_object directly in a simple task ,a long with unit tests that user-changes to input object persist
@nakul680 nakul680 requested a review from haneug June 3, 2026 15:33
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.

3 participants