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

added first iteration of easy_publish #153

Merged
merged 56 commits into from
Sep 29, 2022
Merged
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
828b678
remove exception chaining when given unknown type
isaac-darling Jul 21, 2022
c2af2f3
add easy_publish method to dlhub.client
isaac-darling Jul 21, 2022
9c6041f
fix style in easy_publish
isaac-darling Jul 21, 2022
4e0a17f
add missing whitespace
isaac-darling Jul 21, 2022
e16cc99
fix error message in HelpMessage
isaac-darling Jul 21, 2022
4812942
merge the two static init options into one method
isaac-darling Jul 22, 2022
9f299b8
reorder static create_model params for portability
isaac-darling Jul 22, 2022
4e58649
return the old model constructor for compatibility
isaac-darling Jul 24, 2022
760b703
remove walrus operator, fix help message, revert return to task id
isaac-darling Jul 25, 2022
8e1d3c6
patch publishing test to so it runs without bloat
isaac-darling Jul 25, 2022
03e948f
patch publishing test so that it runs without bloat
isaac-darling Jul 25, 2022
dc9fb36
add functionality for extracting metadata from hints
isaac-darling Jul 27, 2022
0524c89
add auto-inspecting to easy_publish
isaac-darling Jul 27, 2022
1fb6615
switch easy_publish test to a function with hints
isaac-darling Jul 27, 2022
3e573d2
add clarifying comments
isaac-darling Jul 31, 2022
d4e6232
remove commented test skips
isaac-darling Aug 9, 2022
981efe7
add affiliations parameter to easy_publish
isaac-darling Aug 9, 2022
5ba2463
add paper_doi parameter to easy_publish
isaac-darling Aug 11, 2022
026ef66
simplify paper_doi parameter of easy_publish
isaac-darling Aug 11, 2022
3521090
add clarifying comments and extract repeated code
isaac-darling Aug 12, 2022
af04041
Merge branch 'dev' into friendly-publish
isaac-darling Aug 15, 2022
802cfc0
Merge branch 'dev' into auto-extract-metadata
isaac-darling Aug 15, 2022
ba9e7e7
fix code style
isaac-darling Aug 15, 2022
0ecdbbc
add comments to bypass flake8
isaac-darling Aug 16, 2022
bf55004
add pytest-mock to testing-requirements
isaac-darling Aug 16, 2022
c93efeb
add new parameters to easy_publish test
isaac-darling Aug 19, 2022
e35b097
Merge pull request #163 from DLHub-Argonne/dev
ascourtas Aug 26, 2022
fcbd173
update version to 1.0.0 for funcx compat
ascourtas Aug 26, 2022
624a59b
switch to backwards compatible type hints
isaac-darling Sep 13, 2022
83c126f
switch to backwards compatible type hints
isaac-darling Sep 13, 2022
ac7f1d7
switch to backwards compatible type checking
isaac-darling Sep 13, 2022
873f34c
update test model to noop_v11 since v10 has been corrupted (#164)
ascourtas Sep 15, 2022
5e8d8c6
release for test update patch
ascourtas Sep 15, 2022
6b1af9c
Updating RTD Python version to 3.9
blaiszik Sep 15, 2022
1a77bfd
RTD Python to 3.8
blaiszik Sep 15, 2022
3b08006
Add numpy latest requirement
blaiszik Sep 15, 2022
dbc7126
Merge branch 'master' into friendly-publish
isaac-darling Sep 16, 2022
71cb851
Merge branch 'master' into auto-extract-metadata
isaac-darling Sep 16, 2022
5e5d34c
move inspect code to util module
isaac-darling Sep 16, 2022
9310f71
add support for typing type names
isaac-darling Sep 16, 2022
ee975d7
address the behavior of the type checker
isaac-darling Sep 16, 2022
f4ec3c2
Merge branch 'auto-extract-metadata' into friendly-publish
isaac-darling Sep 16, 2022
b1eac69
remove unnecessary comments
isaac-darling Sep 16, 2022
e8576bd
make auto-inspection the default behavior
isaac-darling Sep 16, 2022
08d255a
revert last commit
isaac-darling Sep 16, 2022
f7eb374
adjust publish test to use my function
isaac-darling Sep 16, 2022
ba0a4fe
update condition to isolate subscripted hints
isaac-darling Sep 16, 2022
7cbfded
add tests to improve coverage of python model
isaac-darling Sep 16, 2022
7213660
add test for auto inspecting class methods
isaac-darling Sep 16, 2022
21a2ea0
fix path to pickle file
isaac-darling Sep 16, 2022
88dab48
fix test to cooperate with pickle
isaac-darling Sep 16, 2022
a22de1d
add file for tests on inspect functions
isaac-darling Sep 20, 2022
a9ef0c3
ndarray hints are not subscriptable
isaac-darling Sep 21, 2022
62b77be
add tests for inspect library
isaac-darling Sep 21, 2022
666f5c8
add handling for ndarray shape of Any
isaac-darling Sep 21, 2022
4828b88
add tests for ndarrays of Any shape
isaac-darling Sep 21, 2022
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
8 changes: 7 additions & 1 deletion dlhub_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def get_result(self, task_id, verbose=False):
return result

def easy_publish(self, title: str, creators: Union[str, list[str]], short_name: str, servable_type: str, serv_options: dict[str, Any],
affiliations: list[Sequence[str]] = None):
affiliations: list[Sequence[str]] = None, paper_doi: Sequence[str] = None):
"""Simplified publishing method for servables

Args:
Expand All @@ -364,6 +364,9 @@ def easy_publish(self, title: str, creators: Union[str, list[str]], short_name:
https://dlhub-sdk.readthedocs.io/en/latest/servable-types.html
serv_options (dict): the servable_type specific arguments that are necessary for publishing
Copy link
Contributor

Choose a reason for hiding this comment

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

please add more context for the user on what the servable options are -- ideally, link to documentation

affiliations (list): list of affiliations for each author
paper_doi (list | tuple): sequence containing first the DOI of a paper related to the servable,
and second a member of ("isDescribedBy", "IsDocumentedBy", "IsDerviedFrom") that defines how the paper and
servable relate
Returns:
(string): task id of this submission, can be used to check for success
Raises:
Expand Down Expand Up @@ -397,6 +400,9 @@ def easy_publish(self, title: str, creators: Union[str, list[str]], short_name:
model_info.set_creators(creators, affiliations or []) # affiliations if provided, else empty list
model_info.set_name(short_name)

if paper_doi is not None:
model_info.add_related_resource(paper_doi[0], "DOI", paper_doi[1])
isaac-darling marked this conversation as resolved.
Show resolved Hide resolved

# perform the publish
task_id = self.publish_servable(model_info)

Expand Down