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

WIP: Futures #153

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft

WIP: Futures #153

wants to merge 17 commits into from

Conversation

antarcticrainforest
Copy link
Member

This is a work in progress PR.

Test are not working, I still need to add unit (functional tests).

But that shouldn't prevent you from already starting to review it, mainly because this is a big one. It would be good if you could have a more in depth look at this. That is the database table structure, solr config and especially the code it self.

Very much appreciated.

@antarcticrainforest antarcticrainforest self-assigned this Sep 4, 2023
@antarcticrainforest antarcticrainforest marked this pull request as draft September 4, 2023 11:27
Copy link
Contributor

@Karinon Karinon left a comment

Choose a reason for hiding this comment

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

This is a first review, sorry that it took so long.. Maybe there will be more in the next weeks...

@@ -27,6 +34,9 @@
get_ipython = lambda: None # pragma: no cover

import lazy_import
import nbclient
Copy link
Contributor

Choose a reason for hiding this comment

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

nbclient and nbparametrise are missing in the dev-environment. I had to install them manually.

@@ -11,6 +11,17 @@ services:
- "3306:3306"
volumes:
- ./compose/config/mysql/create_tables.sql:/docker-entrypoint-initdb.d/create_tables.sql:ro
db2:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you add a second database? I don't see any usage

#python_path=/home/wilfred/workspace/climdex-calc
#module=climdex_calc
[plugin:climdexcalc]
python_path=/home/wilfred/workspace/climdex-calc
Copy link
Contributor

Choose a reason for hiding this comment

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

local path which I don't have. I changed the path to locally checked out climdexcalc-plugin but the module name also does not correspond to the one online (climdex_calc vs climdexcalc)

@@ -0,0 +1,148 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

This took me a while: Those are the templates to create content from the futures, aren't they? Please put a separate README in there.

I tried multiple times to execute those notebook like an idiot..

@@ -309,7 +308,7 @@ def databrowser(
multiversion: bool, default: False
Select all versions and not just the latest version (default).
batch_size: int, default: 5000
Size of the search query.
Size of the search querey.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo

futures.Futures.register_future_from_history_id(args.from_id)
else:
if not args.future_definition:
self.parser.error("You have to specify a future template.")
Copy link
Contributor

Choose a reason for hiding this comment

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

The error message says future template, but the arg in the ArgumentParser is called future_definition. Please stick to one word. I was not sure if both are the same.

else:
if not args.future_definition:
self.parser.error("You have to specify a future template.")
raise SystemExit
Copy link
Contributor

Choose a reason for hiding this comment

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

This line is unreachable as self.parser.error throws an Exception by itself


@classmethod
@handled_exception
def register_future_from_history_id(
Copy link
Contributor

Choose a reason for hiding this comment

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

register_future_from_history_id does not consume any kind of parameter except for --from-id, right? Can we make the argument parser more strict so that it does not allow any arguments except for --from-id in this case? I find it confusing that the parameters are passed but don't do anything

Copy link
Contributor

Choose a reason for hiding this comment

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

If that is deliberate than I would have at least an information in the logs that the parameter gets ignored because of $random_reason


self._add_facets_to_parser(
"Set <project> information",
suffix="if the can't be found in the metadata",
Copy link
Contributor

Choose a reason for hiding this comment

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

the what?

Copy link
Contributor

Choose a reason for hiding this comment

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

Besides, suffix does not create a whitespace (because the default is a dot I guess), therefore it concatenates with the description in the passed argument before it. This does not look good when typing --help

if not args.future_definition:
self.parser.error("You have to specify a future template.")
raise SystemExit
futures.Futures.register_future_from_template(
Copy link
Contributor

Choose a reason for hiding this comment

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

time, cmor_table, model are not passed to register_future_from_template, but are valid parameters.

Copy link
Contributor

Choose a reason for hiding this comment

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

If time should be possible: Can we provide examples of valid time-Values? This is not obvious from the help.

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.

2 participants