-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add basic pyproject.toml
for installing dependencies
#13
Conversation
|
4d4354a
to
0ad322a
Compare
@jatkinson1000 installing deps with
Is this down to missing an API key? I find it strange because I'm able to download that URL manually. (And it seems to be a GET, so either it's sending more info in the headers or my request differs to Python's in a bigger way.) |
Yep, I can pass you Arthur's key which I have been using. |
This is tentatively ready for review. Worth noting:
|
pyproject.toml
pyproject.toml
pyproject.toml
for installing dependencies
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.
In general looks good, and thanks for the work on this!
I have successfully pip installed and all built OK!
Didn't really test running, but that's hard to do at this stage.
Only real changes I'd suggest before merging would be to add some more metadata.
We might need a quick chat/check from @arthurBarthe to finalise these.
Left a few comments elsewhere but these are generally optional of for discussion.
[project] | ||
name = "gz_ocean_momentum" | ||
version = "0.0.0" # TODO | ||
description = "TODO" |
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.
We can probably write something tentative here, and/or as Arthur to provide.
where = ["."] # list of folders that contain the packages (["."] by default) | ||
include = ["gz_ocean_momentum", "gz_ocean_momentum.*"] # package names should match these glob patterns (["*"] by default) | ||
#exclude = ["gz_ocean_momentum.tests*", "examples.py"] # exclude packages matching these glob patterns (empty by default) | ||
namespaces = false # to disable scanning PEP 420 namespaces (true by default) |
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.
Since we are imposing black we can add some of this into the file as follows:
[tool.black]
line-length = 88
target-version = ['py37']
include = '\.pyi?$'
exclude = '''
(
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
| foo.py # also separately exclude a file named foo.py in
# the root of the project
)
'''
This is optional though and I'm not sure I fully appreciate what it does at the moment.
Similar tools exist for linting etc.
@@ -41,7 +41,7 @@ | |||
apply coarse graining. Stores the resulting dataset into an MLFLOW \ | |||
experiment within a specific run.' | |||
|
|||
data_location = tempfile.mkdtemp(dir='/scratch/ag7531/temp/') | |||
data_location = tempfile.mkdtemp() |
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 seems that stuff gets stored here after data is downloaded.
We will almost certainly change this when tackling #8 but is it worth setting to a specified local location for now?
Given the data seems to be stored after this script is run I'd also question whether tempfile.mkdtemp()
is the correct command to use given the docs seem to imply it is for temp dirs that should be closed and removed before completion.
This probably isn't the place to deal with this, however.
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.
As I understand, MLflow handles saving output:
mlflow.log_artifact(join(data_location, 'forcing'))
Which currently goes to ./mlruns/0/<hash>/artifacts/forcing
. I think this is a tempdir and used correctly. Still useful to enable overriding (it was done so here), but I have a feeling tempfile
can read envvars to do that.
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.
Used correctly or incorrectly?
I didn't like the use of a tempfile to save important data when I saw it, and really tmpfiles should be cleared before ending the script.
I think you can probably just commit this as it should be dealt with in #4 and doesn't really matter where it creates it for now?
Rough with holes to fill. May not cover all dependencies.
Closes #9 .
pip install -e .
works as expected. CI failures are expected ( see #16 ).Changes:
pyproject.toml