Skip to content

Comments

Move installation to toml based. #249

Merged
crangelsmith merged 7 commits intodevelopfrom
238-toml-tests
Nov 8, 2023
Merged

Move installation to toml based. #249
crangelsmith merged 7 commits intodevelopfrom
238-toml-tests

Conversation

@crangelsmith
Copy link
Collaborator

@crangelsmith crangelsmith commented Nov 3, 2023

  • Move from setup.cfg to pyproject.toml
  • Update precommit and test workflows
  • Some markdown files changed as extra reformatting was added to precommit.

Issue opened for a next PR in #250

To approve this PR it would be great if both @marjanfamili and @jolaem are able to run the installation, precommits and tests as described here: https://github.com/alan-turing-institute/affinity-vae/blob/e3c44807ac9a472844dbe94e0a319fd7ff5d5af2/README.md?plain=1#L27 and here https://github.com/alan-turing-institute/affinity-vae/blob/e3c44807ac9a472844dbe94e0a319fd7ff5d5af2/README.md?plain=1#L37

Run tests locally with:
https://github.com/alan-turing-institute/affinity-vae/blob/e842398dd94e8977c602a7b05389e2e391d38fae/.github/workflows/tests.yml#L18

@crangelsmith crangelsmith marked this pull request as ready for review November 3, 2023 14:54
@crangelsmith crangelsmith mentioned this pull request Nov 3, 2023
python3 -m venv env
source env/bin/activate
pip install -e .
python -m pip install -e .
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since the venv is running from python3 endpoint maybe update this to pyton3 too? or set both to python for consistency.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, good catch!

@jolaem
Copy link
Collaborator

jolaem commented Nov 7, 2023

Testing both via python3 -m pip install -e . and python -m pip install -e ."[test]" installs ok outside Baskerville system. Tests run ok too.

$ python
Python 3.8.10 (default, May 26 2023, 14:05:08) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from avae.model_b import AffinityVAE
>>> vae = AffinityVAE(capacity=8, depth=4, input_size=(32, 32), latent_dims=7)
>>> print(vae)
AffinityVAE(
  (encoder): Encoder(
    (conv_enc): ModuleList(
      (0): Conv2d(1, 8, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
      (1): Conv2d(8, 16, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
      (2): Conv2d(16, 24, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
      (3): Conv2d(24, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
    )
    (norm_enc): ModuleList(
      (0): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (1): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): BatchNorm2d(24, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (3): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    )
    (fc_mu): Linear(in_features=128, out_features=7, bias=True)
    (fc_logvar): Linear(in_features=128, out_features=7, bias=True)
  )
  (decoder): Decoder(
    (conv_dec): ModuleList(
      (0): ConvTranspose2d(32, 24, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
      (1): ConvTranspose2d(24, 16, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
      (2): ConvTranspose2d(16, 8, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
      (3): ConvTranspose2d(8, 1, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
    )
    (norm_dec): ModuleList(
      (0): BatchNorm2d(24, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (1): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (3): BatchNorm2d(1, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    )
    (fc): Linear(in_features=7, out_features=128, bias=True)
  )
)
>>> 

settling to `python` instead of `python3`
adding `python -m pip install --upgrade pip` to instructions
Copy link
Collaborator

@marjanfamili marjanfamili left a comment

Choose a reason for hiding this comment

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

All good for me. I installed and tested everything with python3 and on Mac M1.

@crangelsmith
Copy link
Collaborator Author

Merging this now!

@crangelsmith crangelsmith merged commit 35b07e5 into develop Nov 8, 2023
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.

3 participants