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

Update project internals #36

Merged
merged 10 commits into from
Feb 20, 2018
Merged

Update project internals #36

merged 10 commits into from
Feb 20, 2018

Conversation

mimischi
Copy link
Contributor

@mimischi mimischi commented Feb 13, 2018

Changes made in this pull request:

  • Added Makefile to project.
  • Updated help text and docstrings for generate, submit and analyze.
  • Rephrased and formatted messages printed to the console.
  • mdbenchmark generate will now first look for the .tpr file and only then do everything else.
  • Added unit tests for all messages generated via click.echo() and click.BadParameter().
  • Add unit test for guess_ncores() utility function.

PR Checklist

  • Added changelog fragment in ./changelog/ (more information)?
  • [ ] Issue raised/referenced?

@codecov
Copy link

codecov bot commented Feb 13, 2018

Codecov Report

Merging #36 into master will increase coverage by 14.91%.
The diff coverage is 89.65%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #36       +/-   ##
===========================================
+ Coverage   66.86%   81.78%   +14.91%     
===========================================
  Files          10        8        -2     
  Lines         329      313       -16     
===========================================
+ Hits          220      256       +36     
+ Misses        109       57       -52
Impacted Files Coverage Δ
mdbenchmark/cli.py 76.92% <ø> (ø) ⬆️
mdbenchmark/generate.py 96.42% <100%> (+7.14%) ⬆️
mdbenchmark/submit.py 95.45% <100%> (+62.89%) ⬆️
mdbenchmark/utils.py 98.48% <100%> (+16.39%) ⬆️
mdbenchmark/analyze.py 38.75% <25%> (+2.5%) ⬆️
mdbenchmark/ext/cadishi.py
mdbenchmark/ext/click_test.py

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update baef999...d39cd37. Read the comment docs.

Makefile Outdated
clean-build:
rm --force --recursive build/
rm --force --recursive dist/
rm --force --recursive *.egg-info
Copy link
Contributor

Choose a reason for hiding this comment

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

this might delete your developer installation!

Makefile Outdated
rm --force --recursive *.egg-info

upload:
twine upload dist/*
Copy link
Contributor

Choose a reason for hiding this comment

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

add a dependency chain here.

.PHONY clean-build build upload

clean-build: 

build: clean-build

upload: build

this way we can just say upload and are always sure that the build is clean.

click.echo('Now run `mdbenchmark start` to submit jobs.')
click.echo('Finished generating all benchmarks.')
click.echo('You can now submit the jobs with {}.'.format(
click.style('mdbenchmark start', bold=True)))
Copy link
Contributor

Choose a reason for hiding this comment

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

benchmark submit

@mimischi mimischi changed the title [WIP] Minor cleanup [WIP] Cleanup Feb 13, 2018
@mimischi mimischi force-pushed the changes branch 2 times, most recently from 4403ff0 to 0b3acd3 Compare February 16, 2018 15:25
@mimischi
Copy link
Contributor Author

@kain88-de Besides the missing changelog fragments, this PR should be finished. I have got two questions:

  1. All code in mdbenchmark/ext is untested. Should we write some small tests for this or just tell codecov to ignore that folder? These files are diminishing our overall code coverage.
  2. I changed the exit codes to sys.exit(1), when we exit with an error. I noticed that there is also exit code 2, referring to bad CLI usage. Should we use that when applicable?

@mimischi
Copy link
Contributor Author

Oh, I just noticed a weird edge case with towncrier: if we add several independent features/fix bugs in a PR, we actually need to create several #PR.feature or #PR.bugfix files, but obviously this is not possible.

Putting several changes on multiple lines does also not work in towncrier. What do we do in this case?

@kain88-de
Copy link
Contributor

What do we do in this case?

Several options.

  1. Notice that you included too many changes in a single PR and split it up
  2. Check the towncrier docs/issues for a solution
  3. ditch towncrier.

@kain88-de
Copy link
Contributor

All code in mdbenchmark/ext is untested.

It's not tested anymore in this repo. But the code has been tested before. We only use it as a backup now anyway.

I changed the exit codes to sys.exit(1), when we exit with an error. I noticed that there is also exit code 2, referring to bad CLI usage. Should we use that when applicable?

No just a 1 for error occured. There is no real consistency with exit codes in TUI applications. So let's just stick with 0-OK or 1-Error.

@mimischi mimischi changed the title [WIP] Cleanup Update project internals Feb 19, 2018
@mimischi
Copy link
Contributor Author

mimischi commented Feb 19, 2018

@kain88-de I can't find any other suitable replacement, nor does anyone comment on this issue in the towncrier repository. I would say we just keep it the way it is in this PR, as I just added two short changelog fragmnets.

If you are fine with the PR, we can merge and then I would finally prepare a new release (to finally have the bugfix for mdbenchmark analyze on pip/conda, see #27).

@mimischi mimischi merged commit aeb48d4 into master Feb 20, 2018
@mimischi mimischi deleted the changes branch February 20, 2018 07:54
mimischi added a commit that referenced this pull request Feb 21, 2018
- Added `Makefile` to project.
- Updated help text and docstrings for `generate`, `submit` and `analyze`.
- Rephrased and formatted messages printed to the console.
- `mdbenchmark generate` will now _first_ look for the `.tpr` file and only then do everything else.
- Added unit tests for all messages generated via `click.echo()` and `click.BadParameter()`.
- Add unit test for `guess_ncores()` utility function.
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