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

Test pydantic #178

Draft
wants to merge 90 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
01b9143
wip first commit of analysis helpers
cchall Dec 10, 2024
e9280c5
wip
cchall Dec 10, 2024
fed0e39
wip added Results class
cchall Dec 10, 2024
33682f2
wip symlinks replaced with file contents
cchall Dec 11, 2024
fc570a3
wip small updates
cchall Dec 11, 2024
f374d6e
wip pseudo code start of pydantic parameters
cchall Dec 11, 2024
12ca99d
wip adding abc for code
cchall Jan 21, 2025
576adb7
wip Parameter is usable now
cchall Jan 21, 2025
8bb2b0a
wip better handling for defaults in Codes and adding Setting
cchall Jan 21, 2025
3267c43
wip abc for setup
cchall Jan 21, 2025
c586556
wip
cchall Jan 22, 2025
866737a
wip
cchall Jan 23, 2025
9610119
wip
cchall Jan 24, 2025
9093b48
wip
cchall Jan 24, 2025
037aa78
wip continuing testing of options implementations
cchall Jan 28, 2025
41b5cd9
wip basic options implemented for testing
cchall Jan 28, 2025
28258d1
wip fixing up validation of options
cchall Jan 28, 2025
7dec7f2
wip splitting apart scan and optimize configurations
cchall Jan 29, 2025
d182c87
wip creating mesh_scan option
cchall Jan 29, 2025
56d0774
wip Updates to prepare for integrating parser to libEnsemble setup
cchall Jan 30, 2025
da4afc4
wip starting to interface new parsing and data structures to libEnsem…
cchall Jan 30, 2025
e6fb60e
wip initial hookup working - dfols example runs
cchall Jan 30, 2025
ce4a7d4
wip by-code symlink targets are empty for more cases than not
cchall Jan 30, 2025
fec9d9e
wip add an implementation for user code type
cchall Jan 31, 2025
da7a5eb
wip make options selection into enum
cchall Jan 31, 2025
6ff9fb0
wip Add executor check to configuration model
cchall Jan 31, 2025
9624d59
wip make mesh options software_options
cchall Jan 31, 2025
9f5cf2c
wip changes and fixes to add executor support and get elegant example…
cchall Jan 31, 2025
842204a
wip elegant matching example running
cchall Jan 31, 2025
8f43766
closes #145
cchall Jan 31, 2025
1da1ba3
closes #172
cchall Jan 31, 2025
e4cfb09
wip adjust how exit_criteria is set to get sampler types working
cchall Feb 1, 2025
856352b
wip add opal support
cchall Feb 1, 2025
c08b3cc
wip subclassing str allows a subset of the enum names to be specified…
cchall Feb 1, 2025
4f5f7c6
wip adding madx
cchall Feb 1, 2025
5632ddc
wip more fixes for running sampler jobs
cchall Feb 1, 2025
3f30db6
wip support for flash
cchall Feb 1, 2025
78c5bc9
wip checking dict.get is a bad idea if the value can be 0
cchall Feb 1, 2025
cb90865
wip adding first pass at pydantic models for genesis
cchall Feb 1, 2025
8fe8907
wip moved parse_simulation_input_file into the new parsers module. Th…
cchall Feb 2, 2025
acec4e7
wip lark/pydantic parsing to model works on the genesis input from ge…
cchall Feb 2, 2025
7a8a614
wip grammars for elegant cmd and lattice, spiffe cmd
cchall Feb 3, 2025
38a4090
remove unused testing files
cchall Feb 3, 2025
850a9a1
wip - starting to insert pieces of parser to write code. Prepare to r…
cchall Feb 10, 2025
fe17cb0
Move each Code setup module out of its sub-directory and into rsopt.c…
cchall Feb 10, 2025
e3dfe4c
move serial python execution functions out of codes and into libe_too…
cchall Feb 10, 2025
f9f9912
move model creation into model package
cchall Feb 10, 2025
0c73071
move model creation into model package
cchall Feb 10, 2025
0dbf961
validates re-structuring up through the process of creating a dynamic…
cchall Feb 10, 2025
95f2391
updated the base command model structure so that commands list and ea…
cchall Feb 10, 2025
0a2808a
moves a few files from flash and genesis and updates pathing to compl…
cchall Feb 10, 2025
21aedbd
adds a basic write model functionality under new code organization
cchall Feb 10, 2025
1fedcd0
adds a basic write model functionality under new code organization
cchall Feb 10, 2025
a68b053
Revert "adds a basic write model functionality under new code organiz…
cchall Feb 10, 2025
5da3c3e
add back in writer __init__ that was removed in commit revert 21aedbd…
cchall Feb 10, 2025
405e87f
Give base parameter and setting fields to explicitly set attribute an…
cchall Feb 13, 2025
22d1ae8
Simplifies command writing by using model_dump. Also allows for use o…
cchall Feb 13, 2025
0285bcd
Moves organizing and writing the kwarg dict a job for each Code objec…
cchall Feb 13, 2025
56d3bce
Implements the model editing for spiffe and updates elegant to use pa…
cchall Feb 13, 2025
5e2bf90
parsing function for spiffe. needs to be defined separate from sirepo…
cchall Feb 13, 2025
13b2963
update the spiffe example now that full rsopt functionality is define…
cchall Feb 13, 2025
290b40d
Add the basics of the Genesis parsing and writing following the templ…
cchall Feb 13, 2025
32bcfd0
Small cleanup for spiffe files
cchall Feb 13, 2025
b7ceee6
Noting behavior when #182 occurs
cchall Feb 13, 2025
b96242c
Fixups to get genesis fully working. Mostly just properly handling ty…
cchall Feb 13, 2025
778cc35
Clean up genesis model validation and writing. Adds a formatting func…
cchall Feb 14, 2025
fcdab74
Fix method discriminator so that user can just pass the name to method
cchall Feb 14, 2025
3941bac
Change SUPPORTED_OPTION enum structure to not use aliasing so the mod…
cchall Feb 14, 2025
ab05b93
Add dlib updated dlib option class first pass. Remove unused code fro…
cchall Feb 14, 2025
13d2d4c
Add updated pysot options class and optimizer libEnsemble interface c…
cchall Feb 14, 2025
709747e
Update dlib interface getters and set typing for base model to allow …
cchall Feb 14, 2025
7d898f9
Updated latin hypercube interface and corresponding libEnsemble hooks…
cchall Feb 14, 2025
11af032
Add an argument_passing mode to select kwargs or a single array to pa…
cchall Feb 15, 2025
8aaad25
Add a vectorized parameter to simplify adding repeated parameters tha…
cchall Feb 15, 2025
841708f
fixed bug in pysot option
cchall Feb 15, 2025
ee20475
Allow for not having static outputs. SimSpecs is set internally and s…
cchall Feb 15, 2025
34d7d75
Set up nsga2 option and re-add the deap-nsga2 generator
cchall Feb 15, 2025
eab7fe4
Fixes to get nsga2 generator working. Importantly adds in the persis_…
cchall Feb 16, 2025
715f8dd
Fix dimension property getter name
cchall Feb 16, 2025
1c9f56f
Simplify the checks for executor and make sure that we are creating r…
cchall Feb 16, 2025
6ca4e26
Update parameters of zdt4 example for improved result
cchall Feb 16, 2025
9d01e56
Updates SciPy optimizer support. Provides the template, going forward…
cchall Feb 18, 2025
0b34b01
Splits the libEnsemble setup class off from the base local optimizer …
cchall Feb 18, 2025
1b4f687
Remove completed todo
cchall Feb 18, 2025
110804d
Updating nlopt interface
cchall Feb 18, 2025
c510309
Add scipy to post-run result printout group
cchall Feb 18, 2025
a42fe85
First pass at adding updated xopt mobo generator. Basic implementatio…
cchall Feb 19, 2025
4f46b14
Moves software_options validator to ABC options class so that it won'…
cchall Mar 10, 2025
32ebaa8
wip - intermediate stage of updating aposmm option
cchall Mar 10, 2025
d1cf019
Merge remote-tracking branch 'origin/test_pydantic' into test_pydantic
cchall Mar 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip Parameter is usable now
cchall committed Jan 21, 2025
commit 576adb7235992cf38f46782b83448198513fb47b
14 changes: 10 additions & 4 deletions rsopt/configuration/schemas/parameters.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
from typing import Any, Optional, Union, List
import pydantic

def parameter_discriminator(v: dict) -> str:
if v.get('min'):
return 'numeric'
elif v.get('values'):
return 'category'

class Parameter(pydantic.BaseModel):
name: str
type: str = 'numeric'
group: Optional[str or int] = None

class NumericParameter(pydantic.BaseModel):
class NumericParameter(Parameter):
# TODO: Type of all must match
min: Union[int, float]
max: Union[int, float]
start: Union[int, float]
# TODO: Checking requirement means looking at Options
samples: Optional[int] = 1
scale: Optional[]
# scale: Optional[]

class CategoryParameter(pydantic.BaseModel):
class CategoryParameter(Parameter):
values: List[Union[int, float, str]]