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

Printing a campaign object can be overly verbose when using chemical descriptors #96

Closed
sgbaird opened this issue Jan 22, 2024 · 13 comments

Comments

@sgbaird
Copy link
Contributor

sgbaird commented Jan 22, 2024

Maybe this is intended, but here is an example of the campaign object from the README:

Campaign(searchspace=SearchSpace(discrete=SubspaceDiscrete(parameters=[CategoricalParameter(name='Granularity', _values=('coarse', 'medium', 'fine'), encoding=<CategoricalEncoding.OHE: 'OHE'>), NumericalDiscreteParameter(name='Pressure[bar]', encoding=None, _values=(1.0, 5.0, 10.0), tolerance=0.2), SubstanceParameter(name='Solvent', data={'Solvent A': 'COC', 'Solvent B': 'CCC', 'Solvent C': 'O', 'Solvent D': 'CS(=O)C'}, decorrelate=True, encoding=<SubstanceEncoding.MORDRED: 'MORDRED'>)], exp_rep=   Granularity  Pressure[bar]    Solvent
0       coarse            1.0  Solvent A
1       coarse            1.0  Solvent B
2       coarse            1.0  Solvent C
3       coarse            1.0  Solvent D
4       coarse            5.0  Solvent A
5       coarse            5.0  Solvent B
6       coarse            5.0  Solvent C
7       coarse            5.0  Solvent D
8       coarse           10.0  Solvent A
9       coarse           10.0  Solvent B
10      coarse           10.0  Solvent C
11      coarse           10.0  Solvent D
12      medium            1.0  Solvent A
13      medium            1.0  Solvent B
14      medium            1.0  Solvent C
15      medium            1.0  Solvent D
16      medium            5.0  Solvent A
17      medium            5.0  Solvent B
18      medium            5.0  Solvent C
19      medium            5.0  Solvent D
20      medium           10.0  Solvent A
21      medium           10.0  Solvent B
22      medium           10.0  Solvent C
23      medium           10.0  Solvent D
24        fine            1.0  Solvent A
25        fine            1.0  Solvent B
26        fine            1.0  Solvent C
27        fine            1.0  Solvent D
28        fine            5.0  Solvent A
29        fine            5.0  Solvent B
30        fine            5.0  Solvent C
31        fine            5.0  Solvent D
32        fine           10.0  Solvent A
33        fine           10.0  Solvent B
34        fine           10.0  Solvent C
35        fine           10.0  Solvent D, metadata=    was_recommended  was_measured  dont_recommend
0             False         False           False
1             False         False           False
2             False         False           False
3             False         False           False
4             False         False           False
5             False         False           False
6             False         False           False
7             False         False           False
8             False         False           False
9             False         False           False
10             True          True           False
11            False         False           False
12            False         False           False
13            False         False           False
14            False         False           False
15             True          True           False
16            False         False           False
17            False         False           False
18            False         False           False
19            False         False           False
20            False         False           False
21            False         False           False
22            False         False           False
23            False         False           False
24            False         False           False
25            False         False           False
26            False         False           False
27            False         False           False
28            False         False           False
29             True          True           False
30            False         False           False
31            False         False           False
32            False         False           False
33            False         False           False
34            False         False           False
35            False         False           False, empty_encoding=False, constraints=[], comp_rep=    Granularity_coarse  Granularity_medium  Granularity_fine  Pressure[bar]  \
0                    1                   0                 0            1.0   
1                    1                   0                 0            1.0   
2                    1                   0                 0            1.0   
3                    1                   0                 0            1.0   
4                    1                   0                 0            5.0   
5                    1                   0                 0            5.0   
6                    1                   0                 0            5.0   
7                    1                   0                 0            5.0   
8                    1                   0                 0           10.0   
9                    1                   0                 0           10.0   
10                   1                   0                 0           10.0   
11                   1                   0                 0           10.0   
12                   0                   1                 0            1.0   
13                   0                   1                 0            1.0   
14                   0                   1                 0            1.0   
15                   0                   1                 0            1.0   
16                   0                   1                 0            5.0   
17                   0                   1                 0            5.0   
18                   0                   1                 0            5.0   
19                   0                   1                 0            5.0   
20                   0                   1                 0           10.0   
21                   0                   1                 0           10.0   
22                   0                   1                 0           10.0   
23                   0                   1                 0           10.0   
24                   0                   0                 1            1.0   
25                   0                   0                 1            1.0   
26                   0                   0                 1            1.0   
27                   0                   0                 1            1.0   
28                   0                   0                 1            5.0   
29                   0                   0                 1            5.0   
30                   0                   0                 1            5.0   
31                   0                   0                 1            5.0   
32                   0                   0                 1           10.0   
33                   0                   0                 1           10.0   
34                   0                   0                 1           10.0   
35                   0                   0                 1           10.0   

    Solvent_MORDRED_SpAbs_A  Solvent_MORDRED_nHetero  Solvent_MORDRED_ATS1dv  \
0                  2.828427                      1.0               12.000000   
1                  2.828427                      0.0                4.000000   
2                  0.000000                      1.0                0.000000   
3                  3.464102                      2.0                5.333333   
4                  2.828427                      1.0               12.000000   
5                  2.828427                      0.0                4.000000   
6                  0.000000                      1.0                0.000000   
7                  3.464102                      2.0                5.333333   
8                  2.828427                      1.0               12.000000   
9                  2.828427                      0.0                4.000000   
10                 0.000000                      1.0                0.000000   
11                 3.464102                      2.0                5.333333   
12                 2.828427                      1.0               12.000000   
13                 2.828427                      0.0                4.000000   
14                 0.000000                      1.0                0.000000   
15                 3.464102                      2.0                5.333333   
16                 2.828427                      1.0               12.000000   
17                 2.828427                      0.0                4.000000   
18                 0.000000                      1.0                0.000000   
19                 3.464102                      2.0                5.333333   
20                 2.828427                      1.0               12.000000   
21                 2.828427                      0.0                4.000000   
22                 0.000000                      1.0                0.000000   
23                 3.464102                      2.0                5.333333   
24                 2.828427                      1.0               12.000000   
25                 2.828427                      0.0                4.000000   
26                 0.000000                      1.0                0.000000   
27                 3.464102                      2.0                5.333333   
28                 2.828427                      1.0               12.000000   
29                 2.828427                      0.0                4.000000   
30                 0.000000                      1.0                0.000000   
31                 3.464102                      2.0                5.333333   
32                 2.828427                      1.0               12.000000   
33                 2.828427                      0.0                4.000000   
34                 0.000000                      1.0                0.000000   
35                 3.464102                      2.0                5.333333   

    Solvent_MORDRED_AATS0dv  Solvent_MORDRED_ATSC2p  
0                  4.222222                1.072052  
1                  0.545455               -0.939884  
2                  5.333333                0.002031  
3                  3.844444               -3.587209  
4                  4.222222                1.072052  
5                  0.545455               -0.939884  
6                  5.333333                0.002031  
7                  3.844444               -3.587209  
8                  4.222222                1.072052  
9                  0.545455               -0.939884  
10                 5.333333                0.002031  
11                 3.844444               -3.587209  
12                 4.222222                1.072052  
13                 0.545455               -0.939884  
14                 5.333333                0.002031  
15                 3.844444               -3.587209  
16                 4.222222                1.072052  
17                 0.545455               -0.939884  
18                 5.333333                0.002031  
19                 3.844444               -3.587209  
20                 4.222222                1.072052  
21                 0.545455               -0.939884  
22                 5.333333                0.002031  
23                 3.844444               -3.587209  
24                 4.222222                1.072052  
25                 0.545455               -0.939884  
26                 5.333333                0.002031  
27                 3.844444               -3.587209  
28                 4.222222                1.072052  
29                 0.545455               -0.939884  
30                 5.333333                0.002031  
31                 3.844444               -3.587209  
32                 4.222222                1.072052  
33                 0.545455               -0.939884  
34                 5.333333                0.002031  
35                 3.844444               -3.587209  ), continuous=SubspaceContinuous(parameters=[], constraints_lin_eq=[], constraints_lin_ineq=[])), objective=Objective(mode='SINGLE', targets=[NumericalTarget(name='Yield', mode='MAX', bounds=Interval(lower=-inf, upper=inf), bounds_transform_func=None)], weights=[100.0], combine_func='GEOM_MEAN'), strategy=TwoPhaseStrategy(allow_repeated_recommendations=False, allow_recommending_already_measured=False, initial_recommender=FPSRecommender(), recommender=SequentialGreedyRecommender(surrogate_model=GaussianProcessSurrogate(model_params={}, _model=None), acquisition_function_cls='qEI', hybrid_sampler='None', sampling_percentage=1.0), switch_after=1), measurements_exp=  Granularity  Pressure[bar]    Solvent  Yield  BatchNr  FitNr
0      medium            1.0  Solvent D   79.8        1    NaN
1      coarse           10.0  Solvent C   54.1        1    NaN
2        fine            5.0  Solvent B   59.4        1    NaN
3      medium            1.0  Solvent D   79.8        2    NaN
4      coarse           10.0  Solvent C   54.1        2    NaN
5        fine            5.0  Solvent B   59.4        2    NaN, numerical_measurements_must_be_within_tolerance=True, n_batches_done=2, n_fits_done=0, _cached_recommendation=Empty DataFrame
Columns: []
Index: [])
@Scienfitz
Copy link
Collaborator

Scienfitz commented Jan 23, 2024

Hey Sterling,
yep, the class rep of especially the campaign object is not yet good, its just the builtin from attrs which is bad for dataframes as you display

Fixing this is already on our feature-wishlist / roadmap. One of the issues were facing is that we have an "old" set of workitems in Azure Devops project management (not public). Compared to that, Github project and work item management is surprisingly terrible, this is why we havent moved it anywhere where it is publicly visible yet.

Not sure how to fix that, any suggestions?

@AVHopp
Copy link
Collaborator

AVHopp commented Feb 14, 2024

@sgbaird I just wanted to inform you that we started to implement "pretty printing" functionalities. Once we have implemented the first ones, we will inform you here.

@Scienfitz
Copy link
Collaborator

closing, as this has been resolved with #124

@AVHopp AVHopp reopened this Feb 27, 2024
@AVHopp
Copy link
Collaborator

AVHopp commented Feb 27, 2024

@Scienfitz This is technically not yet completed: Although we have implemented pretty printing for search spaces via #124 , pretty printing for the full campaign object is still ongoing. However, we expect this item to be fully implemented during March :)

@Scienfitz
Copy link
Collaborator

@AVHopp which parts of Campaign can now cause an overly verbose print?

@AVHopp
Copy link
Collaborator

AVHopp commented Feb 27, 2024

The recommender part is not yet printed nicely. Also, the campaign does not yet use the pretty print of the search space, since the other aspects (objective, recommender) are not yet pretty printed and we wanted to avoid having some parts pretty printed while having some still being ugly.

@Scienfitz
Copy link
Collaborator

@AVHopp this issue is about overly verbose campaign print and not about having everything pretty printed.

So if the excessive verbosity has been resolved already with the searchspace pretty print, this issue is closed, if not it should be reopened

@AVHopp
Copy link
Collaborator

AVHopp commented Feb 27, 2024

@Scienfitz Currently, pretty printing of the search space is not yet shown in the campaign, hence this issue is still open.
However, since the functionality is already there, it could be easily included even when the other parts of the campaign are not yet pretty printed.

@Scienfitz
Copy link
Collaborator

@AVHopp so just for my confirmation, the pictures shown in #124 were always generated from a searchspace and did not come from a campaign?

@AVHopp
Copy link
Collaborator

AVHopp commented Feb 27, 2024

@Scienfitz exactly. The idea was to first have PRs for the individual subparts of a campaign and then have one "final" PR using all of the pretty printed objects within the campaign.

@Scienfitz
Copy link
Collaborator

@AVHopp imo theres no need to wait for pretty print of all other objects and the new functionality should simply be added to campaign first as it would solve this issue, then further pretty prints can follow, if you already reference the __str__ of non-pretty printed objects in Campaign they will be automatically updated once the pretty print is implemented, n need to change Campaign each time

@AVHopp
Copy link
Collaborator

AVHopp commented Feb 27, 2024

This will be implemented asap then.

@AVHopp
Copy link
Collaborator

AVHopp commented Mar 14, 2024

By now, this is included, so this issue can be closed.

@AVHopp AVHopp closed this as completed Mar 14, 2024
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

No branches or pull requests

3 participants