-
Notifications
You must be signed in to change notification settings - Fork 2
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
Merge UI fixes and metadata standardizer #365
Changes from 12 commits
db93de2
057803a
7905ce6
15d7b14
25b6fe4
9ecb06e
fe4bbc3
84b4dd6
862f891
a69d512
3030166
eaca413
b0c4273
269f172
720709e
126ce7e
5a7739c
d11283c
d1d57d4
373e763
4a40bee
e3967d6
0257a94
842a6b9
3fd7285
0812106
adab06a
c2a1b5b
476b0c8
b985284
b713d21
637e2db
4acb645
44a537f
0283627
baee6da
c47e93f
b009019
df45f4a
1e1f8e6
2e612ed
dee5419
c23d532
1a351da
04f61b9
fcadcc4
36573cb
de41801
cdd444b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,7 @@ | |
ConfigResponseModel, | ||
) | ||
from .helpers import verify_updated_project | ||
from attribute_standardizer.attr_standardizer_class import AttrStandardizer | ||
|
||
_LOGGER = logging.getLogger(__name__) | ||
|
||
|
@@ -1138,3 +1139,33 @@ def delete_full_history( | |
status_code=400, | ||
detail="Could not delete history. Server error.", | ||
) | ||
|
||
|
||
@project.get( | ||
nleroy917 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"/standardize", | ||
summary="Standardize PEP metadata column headers", | ||
nleroy917 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) | ||
async def get_standardized_cols( | ||
namespace: str, project: str, tag: Optional[str] = DEFAULT_TAG, schema: str = "" | ||
): | ||
""" | ||
Standardize PEP metadata column headers using BEDmess. | ||
|
||
Args: | ||
- pep (str): PEP string to be standardized | ||
- schema (str): Schema for AttrStandardizer | ||
nleroy917 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Returns: | ||
- dict: Standardized results | ||
""" | ||
|
||
if schema == "": | ||
nleroy917 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return {} | ||
|
||
path = namespace + "/" + project + ":" + tag | ||
print(path) | ||
nleroy917 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
model = AttrStandardizer(schema) | ||
|
||
results = model.standardize(pep=path) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems a little inefficient, no? We are already on PEPhub, but it seems like the attribute standardized is getting it... from PEPhub? But we are already there so its making a request to itself. This is probably an implementation detail in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. opened: databio/bedms#16 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch |
||
return {"results": results} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this isnt pephub but I still wanna say I don't like the ergonomics of this import 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed a little bit bedbs, so now you can do:
from attribute_standardizer import AttrStandardizer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you push to bedms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already there, I added it with input changes